Re: Tcl_SetStringObj question
- From: Don Porter <dgp@xxxxxxxx>
- Date: Mon, 28 Jul 2008 12:34:37 -0400
icanbob@xxxxxxxxx wrote:
resultPtr = Tcl_GetObjResult(interp);
Tcl_SetStringObj(resultPtr, myname, sizeof(myname));
Don't Do That.
That code may work fine for a long time until
circumstances conspire to place a shared value
in the interp result, and the whole thing goes
BOOM!
Do This Instead:
Tcl_SetObjResult(interp, Tcl_NewStringObj(myname, -1));
--
| Don Porter Mathematical and Computational Sciences Division |
| donald.porter@xxxxxxxx Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
.
- References:
- Tcl_SetStringObj question
- From: icanbob
- Tcl_SetStringObj question
- Prev by Date: Re: [XOTcl] Referencing values in an array
- Next by Date: Re: Referencing values in an array
- Previous by thread: Re: Tcl_SetStringObj question
- Index(es):