summaryrefslogtreecommitdiffstats
path: root/generic/tclEvent.c
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-06-22 19:47:34 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-06-22 19:47:34 (GMT)
commitffaaf5eb1b4fa2ddfffd6cdf8a3668e82fc88ea9 (patch)
tree1833884e76878788fcdb5562ceb860d990199d46 /generic/tclEvent.c
parent7ee7db08b5e81da44b8fe1bbdfc8d44c8d5791cc (diff)
downloadtcl-ffaaf5eb1b4fa2ddfffd6cdf8a3668e82fc88ea9.zip
tcl-ffaaf5eb1b4fa2ddfffd6cdf8a3668e82fc88ea9.tar.gz
tcl-ffaaf5eb1b4fa2ddfffd6cdf8a3668e82fc88ea9.tar.bz2
bug 1225727
Diffstat (limited to 'generic/tclEvent.c')
-rw-r--r--generic/tclEvent.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index 6e2a4df..3ecf3f1 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.57 2005/05/10 18:34:35 kennykb Exp $
+ * RCS: @(#) $Id: tclEvent.c,v 1.58 2005/06/22 19:47:42 kennykb Exp $
*/
#include "tclInt.h"
@@ -946,10 +946,24 @@ Tcl_Finalize()
TclFinalizeDoubleConversion();
/*
+ * 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,
+ * and Tcl_FinalizeThreadAlloc or Tcl_FinalizeMemorySubsystem
+ * will result in a corrupted heap. The result can be a
+ * mysterious crash on process exit. Check here that
+ * nobody's done this.
+ */
+
+ if ( firstExitPtr != NULL ) {
+ Tcl_Panic( "exit handlers were created during Tcl_Finalize" );
+ }
+
+ /*
* There shouldn't be any malloc'ed memory after this.
*/
#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC)
- TclFinalizeThreadAlloc();
+ TclFinalizeThreadAlloc();
#endif
TclFinalizeMemorySubsystem();
inFinalize = 0;