diff options
author | nijtmans <nijtmans@noemail.net> | 2008-10-04 12:54:14 (GMT) |
---|---|---|
committer | nijtmans <nijtmans@noemail.net> | 2008-10-04 12:54:14 (GMT) |
commit | 94200aa0d49f928c5985480d3d7c473c16ddb5f1 (patch) | |
tree | 2b574ad22c7f9498255051014f0597f3078a3820 /generic/tclLoad.c | |
parent | a36271c055ce62da4e2536b45f00915e299b3b70 (diff) | |
download | tcl-94200aa0d49f928c5985480d3d7c473c16ddb5f1.zip tcl-94200aa0d49f928c5985480d3d7c473c16ddb5f1.tar.gz tcl-94200aa0d49f928c5985480d3d7c473c16ddb5f1.tar.bz2 |
* generic/tclLoad.c: Make sure that any library which
doesn't have an unloadproc is only really unloaded when
no library code is executed yet. [Bug 2059262]
FossilOrigin-Name: 535ff978c5692d303ddfe12e0d3b95f03991f443
Diffstat (limited to 'generic/tclLoad.c')
-rw-r--r-- | generic/tclLoad.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/generic/tclLoad.c b/generic/tclLoad.c index 6c1c483..479c1fb 100644 --- a/generic/tclLoad.c +++ b/generic/tclLoad.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclLoad.c,v 1.18 2008/07/21 21:25:21 nijtmans Exp $ + * RCS: @(#) $Id: tclLoad.c,v 1.19 2008/10/04 12:54:14 nijtmans Exp $ */ #include "tclInt.h" @@ -791,7 +791,9 @@ Tcl_UnloadObjCmd( if (unLoadProcPtr != NULL) { Tcl_MutexLock(&packageMutex); - unLoadProcPtr(pkgPtr->loadHandle); + if (pkgPtr->unloadProc != NULL) { + unLoadProcPtr(pkgPtr->loadHandle); + } /* * Remove this library from the loaded library cache. @@ -1144,7 +1146,7 @@ TclFinalizeLoad(void) */ if (pkgPtr->fileName[0] != '\0') { - if (pkgPtr->unLoadProcPtr != NULL) { + if ((pkgPtr->unLoadProcPtr != NULL) && (pkgPtr->unloadProc != NULL)) { pkgPtr->unLoadProcPtr(pkgPtr->loadHandle); } } |