summaryrefslogtreecommitdiffstats
path: root/generic/tclEvent.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-08-03 22:23:16 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-08-03 22:23:16 (GMT)
commit3a01c00096553941d5e1f1cc1e2048bb9b119376 (patch)
tree85f6e39a72f6b9fc313e2cf60c7608fcd62b4c01 /generic/tclEvent.c
parentc918210ee55ae018cc40f8a8b411feed5af07de4 (diff)
downloadtcl-3a01c00096553941d5e1f1cc1e2048bb9b119376.zip
tcl-3a01c00096553941d5e1f1cc1e2048bb9b119376.tar.gz
tcl-3a01c00096553941d5e1f1cc1e2048bb9b119376.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.c38
1 files changed, 27 insertions, 11 deletions
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index acabcc0..c8944f7 100644
--- a/generic/tclEvent.c
+++ b/generic/tclEvent.c
@@ -11,7 +11,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.28.2.11 2005/06/24 18:21:39 kennykb Exp $
+ * RCS: @(#) $Id: tclEvent.c,v 1.28.2.12 2005/08/03 22:23:42 dgp Exp $
*/
#include "tclInt.h"
@@ -833,15 +833,29 @@ Tcl_Finalize()
* order dependencies.
*/
- TclFinalizeCompExecEnv();
+ TclFinalizeCompilation();
+ TclFinalizeExecution();
TclFinalizeEnvironment();
/*
* Finalizing the filesystem must come after anything which
* might conceivably interact with the 'Tcl_FS' API.
*/
+
TclFinalizeFilesystem();
+ /*
+ * Undo all the 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
@@ -870,13 +884,6 @@ Tcl_Finalize()
Tcl_SetPanicProc(NULL);
/*
- * 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.
@@ -910,14 +917,23 @@ Tcl_Finalize()
}
#endif
+ 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) && !defined(TCL_MEM_DEBUG) && !defined(PURIFY)
TclFinalizeThreadAlloc();
#endif
+ /*
+ * At this point, there should no longer be any ckalloc'ed memory.
+ */
+
TclFinalizeMemorySubsystem();
inFinalize = 0;
}