Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Memory leak in Tcl_ExitThread()

Closed / Fixed464380ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2001-09-24 12:08:24
Tcl_FinalizeThread is not only called by Tcl_Finalize, 
but also by Tcl_ExitThread. There however, the 
reference count of tsdPtr->tclLibraryPath is not 
decremented. This results in a memory leak when 
creating and destroying threads.

Attached is a patch for tclEvent.c that checks for and 
frees this object in Tcl_FinalizeThread instead of in 
Tcl_Finalize.

-> fix memory leak in Tcl_ExitThread
rbrunnerplain2001-09-24 19:08:25
File Added - 11139: tclEvent-patch-8.4a3
andreas_kupriesplain2001-09-25 00:55:50
Logged In: YES 
user_id=75003

Change accepted and committed to HEAD and the 8.3.3 branch.
hobbsplain2001-10-03 23:40:04
Logged In: YES 
user_id=72656

Had to adjust where in Tcl_FinalizeThread this was called 
(to before the thread exit handlers) to support thread-
local storage use for objects in the threaded object 
allocator proposed by Zoran.
Log in (anonymous is fine) to add a comment.

Attachments: