diff options
author | dgp <dgp@users.sourceforge.net> | 2005-08-03 22:25:11 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2005-08-03 22:25:11 (GMT) |
commit | eb0feb979757670c7509380a53ba1af03cb44666 (patch) | |
tree | d3d346d9696c2ed7102776449429926b3ed1172b /generic/tclEvent.c | |
parent | 68517f66103e7b5b1f60f0abd4259b084b0e43b6 (diff) | |
download | tcl-eb0feb979757670c7509380a53ba1af03cb44666.zip tcl-eb0feb979757670c7509380a53ba1af03cb44666.tar.gz tcl-eb0feb979757670c7509380a53ba1af03cb44666.tar.bz2 |
* generic/tclCompExpr.c: Untangled some dependencies in the
* generic/tclEvent.c: order of finalization routines.
* generic/tclInt.h: [Bug 1251399]
* generic/tclObj.c:
Diffstat (limited to 'generic/tclEvent.c')
-rw-r--r-- | generic/tclEvent.c | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/generic/tclEvent.c b/generic/tclEvent.c index e70ce67..66c8f85 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclEvent.c,v 1.60 2005/07/17 21:17:40 dkf Exp $ + * RCS: @(#) $Id: tclEvent.c,v 1.61 2005/08/03 22:25:11 dgp Exp $ */ #include "tclInt.h" @@ -874,7 +874,8 @@ Tcl_Finalize() * done after the exit handlers, because there are order dependencies. */ - TclFinalizeCompExecEnv(); + TclFinalizeCompilation(); + TclFinalizeExecution(); TclFinalizeEnvironment(); /* @@ -884,6 +885,18 @@ Tcl_Finalize() TclFinalizeFilesystem(); + /* + * Undo all Tcl_ObjType registrations, and reset the master list + * of free Tcl_Obj's. After this returns, no more Tcl_Obj's should + * be allocated or freed. + * + * Note in particular that TclFinalizeObjects() must follow + * TclFinalizeFilesystem() because TclFinalizeFilesystem free's + * the Tcl_Obj that holds the path of the current working directory. + */ + + TclFinalizeObjects(); + /* * We must be sure the encoding finalization doesn't need to examine * the filesystem in any way. Since it only needs to clean up @@ -909,13 +922,6 @@ Tcl_Finalize() TclFinalizeThreadData(); /* - * Free synchronization objects. There really should only be one - * thread alive at this moment. - */ - - TclFinalizeSynchronization(); - - /* * We defer unloading of packages until very late to avoid memory * access issues. Both exit callbacks and synchronization variables * may be stored in packages. @@ -952,14 +958,23 @@ Tcl_Finalize() Tcl_Panic("exit handlers were created during Tcl_Finalize"); } + TclFinalizePreserve(); + /* - * There shouldn't be any malloc'ed memory after this. + * Free synchronization objects. There really should only be one + * thread alive at this moment. */ - TclFinalizePreserve(); + TclFinalizeSynchronization(); + #if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC) TclFinalizeThreadAlloc(); #endif + + /* + * At this point, there should no longer be any ckalloc'ed memory. + */ + TclFinalizeMemorySubsystem(); inFinalize = 0; } |