summaryrefslogtreecommitdiffstats
path: root/generic
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
parent7ee7db08b5e81da44b8fe1bbdfc8d44c8d5791cc (diff)
downloadtcl-ffaaf5eb1b4fa2ddfffd6cdf8a3668e82fc88ea9.zip
tcl-ffaaf5eb1b4fa2ddfffd6cdf8a3668e82fc88ea9.tar.gz
tcl-ffaaf5eb1b4fa2ddfffd6cdf8a3668e82fc88ea9.tar.bz2
bug 1225727
Diffstat (limited to 'generic')
-rw-r--r--generic/tclEvent.c18
-rw-r--r--generic/tclIO.c3
-rw-r--r--generic/tclInt.h3
3 files changed, 20 insertions, 4 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;
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 0aeb6b8..0766e19 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIO.c,v 1.89 2005/06/07 20:37:40 dkf Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.90 2005/06/22 19:47:43 kennykb Exp $
*/
#include "tclInt.h"
@@ -270,6 +270,7 @@ TclFinalizeIOSubsystem()
statePtr->flags |= CHANNEL_DEAD;
}
}
+ TclpFinalizePipes();
}
/*
diff --git a/generic/tclInt.h b/generic/tclInt.h
index f431d35..4d13329 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -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: tclInt.h,v 1.238 2005/06/21 19:49:25 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclInt.h,v 1.239 2005/06/22 19:48:08 kennykb Exp $
*/
#ifndef _TCLINT
@@ -2031,6 +2031,7 @@ MODULE_SCOPE int TclpDeleteFile _ANSI_ARGS_((CONST char *path));
MODULE_SCOPE void TclpFinalizeCondition _ANSI_ARGS_((
Tcl_Condition *condPtr));
MODULE_SCOPE void TclpFinalizeMutex _ANSI_ARGS_((Tcl_Mutex *mutexPtr));
+MODULE_SCOPE void TclpFinalizePipes _ANSI_ARGS_((void));
MODULE_SCOPE void TclpFinalizeThreadData _ANSI_ARGS_((
Tcl_ThreadDataKey *keyPtr));
MODULE_SCOPE int TclpThreadCreate _ANSI_ARGS_((