diff options
author | ferrieux <ferrieux@users.sourceforge.net> | 2011-08-09 17:19:33 (GMT) |
---|---|---|
committer | ferrieux <ferrieux@users.sourceforge.net> | 2011-08-09 17:19:33 (GMT) |
commit | 4d4745325d734b353c706c2b9ec0c1fc12ffaee2 (patch) | |
tree | 82fd16a3ebffc1553c7b6bb3847e036f9fd6cc61 /generic/tclExecute.c | |
parent | e35a4ea9a4007bfed1a2df232c50e6be801fa580 (diff) | |
download | tcl-4d4745325d734b353c706c2b9ec0c1fc12ffaee2.zip tcl-4d4745325d734b353c706c2b9ec0c1fc12ffaee2.tar.gz tcl-4d4745325d734b353c706c2b9ec0c1fc12ffaee2.tar.bz2 |
[Bug 2919042] Restore "valgrindability" of Tcl that was lost by the streamlining of [exit], by conditionally forcing a full Finalize: use -DPURIFY or ::env(TCL_FINALIZE_ON_EXIT)
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index a7d6184..691c8d7 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -53,6 +53,8 @@ static int execInitialized = 0; TCL_DECLARE_MUTEX(execMutex) +static int cachedInExit = 0; + #ifdef TCL_COMPILE_DEBUG /* * Variable that controls whether execution tracing is enabled and, if so, @@ -896,7 +898,7 @@ static void DeleteExecStack( ExecStack *esPtr) { - if (esPtr->markerPtr) { + if (esPtr->markerPtr && !cachedInExit) { Tcl_Panic("freeing an execStack which is still in use"); } @@ -915,6 +917,8 @@ TclDeleteExecEnv( { ExecStack *esPtr = eePtr->execStackPtr, *tmpPtr; + cachedInExit = TclInExit(); + /* * Delete all stacks in this exec env. */ @@ -930,10 +934,10 @@ TclDeleteExecEnv( TclDecrRefCount(eePtr->constants[0]); TclDecrRefCount(eePtr->constants[1]); - if (eePtr->callbackPtr) { - Tcl_Panic("Deleting execEnv with pending NRE callbacks!"); + if (eePtr->callbackPtr && !cachedInExit) { + Tcl_Panic("Deleting execEnv with pending TEOV callbacks!"); } - if (eePtr->corPtr) { + if (eePtr->corPtr && !cachedInExit) { Tcl_Panic("Deleting execEnv with existing coroutine"); } ckfree(eePtr); |