.
D 2018-11-14T17:30:06.272
L (Initi/Fin)alize
P 224fbdfaef31c226f65e481581b9a6bbeee31472edf5ed47bc8f362712010b7d
U aku
W 1806
<h1>Source Files</h1>
* portions of [/finfo?name=generic/tclEvent.c|tclEvent.c]
<h1>Public Interface</h1>
* Tcl_CreateExitHandler
* Tcl_DeleteExitHandler
* Tcl_CreateThreadExitHandler
* Tcl_DeleteThreadExitHandler
* Tcl_SetExitProc
* Tcl_Exit
* Tcl_Finalize
* Tcl_FinalizeThread
<h1>Private Interface</h1>
* TclCreateLateExitHandler
* TclDeleteLateExitHandler
* TclInitSubsystems
* TclInExit
* TclInThreadExit
<h1>Configuration Defines</h1>
* <code>TCL_FINALIZE_ON_EXIT</code> - When defined, free all memory on exit, despite the OS cleaning up after anyway. This reduces reports of false resource leaks for both dynamic and static memory trackers (valgrind, coverity). <b>Note</b> that for dynamic memory tracking it is best to also arrange for the builtin <code>exit</code> to be a no-op, i.e. <code>proc exit args {}</code>.
<h1>Directly Depends On Public Interface</h1>
* <i>just about everything</i>
<h1>Directly Depends On Private Interface of</h1>
* <i>just about everything</i>
<h1>Discussion</h1>
This module is devoted to control over the initialization
and finalization of the subsystems of Tcl, and extensions to it by way of
exit handlers and thread exit handlers. This is the part that could use a
good audit and reform, particularly in examining multi-threaded
finalization.
The routine <b>TclInitSubsystems</b> needs to become
public, so that Tcl using apps can bring up and tear down the Tcl library
via an approved set of routines.
It may be that the <b>TclIn(Thread)Exit</b>
routines are needed by extensions as well. Or as an alternative,
it would be nice if Tcl finalization were well-behaved enough
that nothing else had to care whether or not they were
running "in exit".
Z 2ff98533b338a61d6108659db12be8a9