memory leak in ttrace
Closed / Invalid2777803fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2009-04-21 19:44:23
there appears to be a memory leak when sourcing ttrace.tcl.
namespace eval ttrace {
...
variable mutex thread::mutex
variable elock [$mutex create]
...}
the mutex elock is never released when the thread & interpreter are recycled (i am using websh).
i added a specific mutex destroy comand in the ttrace::cleanup procedure which solved the leak. but i don't think this is correct..
i am using the latest thread from the cvs repository, with changes to replace Tcl_Alloc with ckalloc...
ferrieuxplain2009-05-05 04:33:48
Mutexes and other sync primitives are opaque handles, not Tcl_Obj values, and are not managed through the usual Tcl-level refcounts. Hence the need for explicit [thread::mutex destroy] et al. So the cleanup procedure is actually the idiomatic way of doing it.
Log in (anonymous is fine) to add a comment.