Artifacts Associated With Ticket 229181
Ticket change [97e739b577] (rid 110516) by nobody on 2001-01-17 22:18:11:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Running and embedded interpreter from C++. The following code leaks memory. ... while(1){ char* theScript = GetScript(); returnLength = NPstrlen( theScript ); theObj = Tcl_NewUnicodeObj(theScript, returnLength ); Tcl_EvalObjEx(theInterp, theObj , TCL_EVAL_DIRECT ); } However, once you switch to pre-compiling the scripts into bytecode objects and using them, the leak disappears. Seems that the compile stage is not 100%. - foundin initialized to: "obsolete: 8.4a1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "10. Objects"
- title initialized to: "Compiler Leaks Memory"
- type initialized to: "Bug"
Ticket change [a2aa4ed798] (rid 109935) by dkf on 2001-01-18 17:11:31:
- closedate changed to: "2001-01-18T10:11:31"
- closer changed to: "dkf"
- icomment:
The code, as written, is failing to call Tcl_IncrRefCount prior to calling Tcl_EvalObjEx amd Tcl_DecrRefCount afterwards. Add these calls and everything will be hunky-dory (assuming the string returned by GetScript() is cleaned up right too, of course.) while(1){ char* theScript = GetScript(); returnLength = NPstrlen( theScript ); theObj = Tcl_NewUnicodeObj(theScript, returnLength ); Tcl_IncrRefCount(theObj); Tcl_EvalObjEx(theInterp, theObj , TCL_EVAL_DIRECT ); Tcl_DecrRefCount(theObj); } - login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "dkf"