Overview
| Artifact ID: | af970e281116c0cd9ba22d28ee44918a15aa7a68 |
|---|---|
| Ticket: | 229969ffffffffffffffffffffffffffffffffff
Memory Leak TCL 8.3.0 in TclAlloc |
| User & Date: | nobody on 2001-01-24 21:36:26 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
I am creating a interpreter in a C++ program using the call Tcl_CreateInterp after that I use Tcl_SetVar to define variable values and then call Tcl_EvalFile to evaluate a script . The code that is running the interpreter is running in its own thread and I use Tcl_GetVar and Tcl_SetVar to communicate with the interpreter from another thread. All works great but when I delete the interpeter with Tcl_DeleteInterp I find a memory leak of about 10 k due to Tcl_Alloc (using Solaris Workshop Leak Check). According to My latest TCL/TK book (Welch) calling Tcl_DeleteInterp only marks the interpreter as deleteable and only deletes if Tcl_Release is called as Many Times as Tcl_Preserve. I modified the Tcl Code to emit a message to stdout when Tcl_Preserve is called. At no time is the message seen unless I specifically call it in my C++ program. I have called Tcl_UnsetVar on all my global variable prior to deletion and it has no effect. All my variables are set with the option TCL_GLOBAL_ONLY flag. 1 ) if the call Tcl_DeleteInterp marks the interpreter as deletable and then returns how is the deletion code ever going to run ? 2) If Tcl_DeleteInterp does indeed try to remove all memory before returning then you have a memory leak problem. 3) If you don't think you have a memory leak problem then given the information above how do I free the variables I Set and Get. What concerns me is that Tcl reassigns the memory that a variable possesses every time it is set. Do I have to free that memory first before setting (i.e char * data = Tcl_GetVar(interp,"data",TCL_GLOBAL_ONLY); Tcl_Free(data); ?
- foundin changed to: "obsolete: 8.3"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "95. contrib ports"
- title changed to: "Memory Leak TCL 8.3.0 in TclAlloc"
- type changed to: "Bug"