summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-08-16 15:23:56 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-08-16 15:23:56 (GMT)
commit2eb6a95d75570627224f1fd4981d636cf0d7bed9 (patch)
tree043fc269fcd11e1c2f152630d123467d31176474
parentae439fa7370d07b215450d9016c40b4196bb0b95 (diff)
downloadtcl-2eb6a95d75570627224f1fd4981d636cf0d7bed9.zip
tcl-2eb6a95d75570627224f1fd4981d636cf0d7bed9.tar.gz
tcl-2eb6a95d75570627224f1fd4981d636cf0d7bed9.tar.bz2
backport of 2005-08-10 fix to tclEvent.c
-rw-r--r--ChangeLog7
-rw-r--r--generic/tclEvent.c38
2 files changed, 26 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 27ddb3f..5a18b04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-08-16 Kevin Kenny <kennykb@acm.org>
+
+ * generic/tclEvent.c (Tcl_Finalize): Pushed Tcl_FinalizeLoad and
+ Tcl_ResetFilesystem down after Tcl_FinalizeThreadAlloc because
+ unloading DLLs can't happen while they still own TSD keys.
+ (This is a backport of changes made in the HEAD on 2005-08-10.)
+
2005-08-05 Donal K. Fellows <donal.k.fellows@man.ac.uk>
* unix/tclUnixInit.c (localeTable): Solaris uses a non-standard
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index c8944f7..ba065eb 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.12 2005/08/03 22:23:42 dgp Exp $
+ * RCS: @(#) $Id: tclEvent.c,v 1.28.2.13 2005/08/16 15:23:56 kennykb Exp $
*/
#include "tclInt.h"
@@ -884,24 +884,6 @@ Tcl_Finalize()
Tcl_SetPanicProc(NULL);
/*
- * We defer unloading of packages until very late
- * to avoid memory access issues. Both exit callbacks and
- * synchronization variables may be stored in packages.
- *
- * Note that TclFinalizeLoad unloads packages in the reverse
- * of the order they were loaded in (i.e. last to be loaded
- * is the first to be unloaded). This can be important for
- * correct unloading when dependencies exist.
- *
- * Once load has been finalized, we will have deleted any
- * temporary copies of shared libraries and can therefore
- * reset the filesystem to its original state.
- */
-
- TclFinalizeLoad();
- TclResetFilesystem();
-
- /*
* There have been several bugs in the past that cause
* exit handlers to be established during Tcl_Finalize
* processing. Such exit handlers leave malloc'ed memory,
@@ -931,6 +913,24 @@ Tcl_Finalize()
#endif
/*
+ * We defer unloading of packages until very late
+ * to avoid memory access issues. Both exit callbacks and
+ * synchronization variables may be stored in packages.
+ *
+ * Note that TclFinalizeLoad unloads packages in the reverse
+ * of the order they were loaded in (i.e. last to be loaded
+ * is the first to be unloaded). This can be important for
+ * correct unloading when dependencies exist.
+ *
+ * Once load has been finalized, we will have deleted any
+ * temporary copies of shared libraries and can therefore
+ * reset the filesystem to its original state.
+ */
+
+ TclFinalizeLoad();
+ TclResetFilesystem();
+
+ /*
* At this point, there should no longer be any ckalloc'ed memory.
*/