summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2018-06-26 17:07:02 (GMT)
committerdgp <dgp@users.sourceforge.net>2018-06-26 17:07:02 (GMT)
commit968382225704b01ee24ffa2764db83b5549b279d (patch)
tree0debd45093f1e024dcb0b40ba968a09bc077ba48
parentbf884c9bc9d2e89919144c2271c72b96a1eebbef (diff)
parent9da2aebeaebd1ccbfa806b0c3550774abc7ad778 (diff)
downloadtcl-968382225704b01ee24ffa2764db83b5549b279d.zip
tcl-968382225704b01ee24ffa2764db83b5549b279d.tar.gz
tcl-968382225704b01ee24ffa2764db83b5549b279d.tar.bz2
merge 8.6
-rw-r--r--generic/tclInt.h1
-rw-r--r--generic/tclTest.c16
-rw-r--r--generic/tclThreadTest.c17
3 files changed, 8 insertions, 26 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 9cd4578..64e7c67 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -4634,7 +4634,6 @@ MODULE_SCOPE Tcl_PackageInitProc TclObjTest_Init;
MODULE_SCOPE Tcl_PackageInitProc TclThread_Init;
MODULE_SCOPE Tcl_PackageInitProc Procbodytest_Init;
MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
-MODULE_SCOPE void TclThreadTestFinalize();
/*
*----------------------------------------------------------------
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 814d734..ac01ecf 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -44,7 +44,6 @@
DLLEXPORT int Tcltest_Init(Tcl_Interp *interp);
DLLEXPORT int Tcltest_SafeInit(Tcl_Interp *interp);
-EXTERN TCL_NORETURN void Tcltest_Exit(ClientData clientData);
/*
* Dynamic string shared by TestdcallCmd and DelCallbackProc; used to collect
@@ -571,10 +570,6 @@ Tcltest_Init(
return TCL_ERROR;
}
-
- /* Finalizer */
- Tcl_SetExitProc(Tcltest_Exit);
-
/*
* Create additional commands and math functions for testing Tcl.
*/
@@ -802,17 +797,6 @@ Tcltest_SafeInit(
return Procbodytest_SafeInit(interp);
}
-TCL_NORETURN void Tcltest_Exit(
- ClientData clientData
-) {
- int status = PTR2INT(clientData);
- Tcl_Finalize();
- TclThreadTestFinalize();
- TclpExit(status);
- Tcl_Panic("OS exit failed!");
-}
-
-
/*
*----------------------------------------------------------------------
*
diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c
index 6da26db..1742eb7 100644
--- a/generic/tclThreadTest.c
+++ b/generic/tclThreadTest.c
@@ -174,15 +174,6 @@ TclThread_Init(
Tcl_CreateObjCommand(interp, "testthread", ThreadObjCmd, NULL, NULL);
return TCL_OK;
}
-
-
-void TclThreadTestFinalize() {
- if (errorProcString != NULL) {
- ckfree(errorProcString);
- errorProcString= NULL;
- }
- return;
-}
/*
*----------------------------------------------------------------------
@@ -1166,6 +1157,14 @@ ThreadExitProc(
Tcl_MutexLock(&threadMutex);
+ if (self == errorThreadId) {
+ if (errorProcString) { /* Extra safety */
+ ckfree(errorProcString);
+ errorProcString = NULL;
+ }
+ errorThreadId = 0;
+ }
+
if (threadEvalScript) {
ckfree(threadEvalScript);
threadEvalScript = NULL;