Tcl Source Code

View Ticket
Login
Ticket UUID: 464380
Title: Memory leak in Tcl_ExitThread()
Type: Bug Created on: 2001-09-24 12:08:24
Submitter: rbrunner Assigned to: andreas_kupries
Subsystem: 49. Threading Severity:
Priority: 7 High Last modified: 2001-10-03 23:40:04
Status: Closed Closed by: hobbs
Resolution: Fixed Closed on: 2001-10-03 16:40:04
Version: obsolete: 8.4a3
Description:
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
User Comments:
rbrunner added on 2001-09-24 19:08:25:

File Added - 11139: tclEvent-patch-8.4a3

andreas_kupries added on 2001-09-25 00:55:50:
Logged In: YES 
user_id=75003

Change accepted and committed to HEAD and the 8.3.3 branch.

hobbs added on 2001-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.

Attachments: