tcl-websh-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ronnie Brunner <>
Subject Re: what is the point of 'initial' ?
Date Thu, 25 Jul 2002 08:56:31 GMT
I had to hack something yesterday to fix the memory leak: the problem
is as follows: up to now Tcl_CreateThreadExitHandler was called every
time when an interp was created. This left some stuff lying around
when the interpreter was killed.
So I tried to make sure it's only called initially (hence: if (initial)), 
because the original if clause checking for Tcl_GetMaster doesn't do
the job. 
However: the problem now is: why did Simon use Tcl_CreateThreadExitHandler
in the first place. Is it really to be called on thread exit or rather
on interp deletion? or at program exit? I have to look into this to
hopefully avoid that shitty "initial" hack you found in the repository.

Any hints are welcome.

> It appears to be this:
>     if (initial) {
> 	Tcl_CreateThreadExitHandler(dRequestData, (ClientData) requestData);
>     }
> but CreateThreadExitHandler does this:
>         Tcl_CreateThreadExitHandler arranges for proc to be invoked by
>         Tcl_FinalizeThread and Tcl_ExitThread.
> And those aren't called anywhere that I can see...
> Am I missing something?

Ronnie Brunner                     
Netcetera AG, 8040 Zuerich     phone +41 1 247 79 79 fax +41 1 247 70 75

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message