summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authornijtmans <nijtmans>2008-11-13 22:34:33 (GMT)
committernijtmans <nijtmans>2008-11-13 22:34:33 (GMT)
commit1dc34345abbeeb394c746abc809889b36af93584 (patch)
tree5e0965c72984533c7c66feaa10fdbbda08db3006 /generic
parente1dd76f8cbed9c460c1787cd88d0a058a6d46c7c (diff)
downloadtcl-1dc34345abbeeb394c746abc809889b36af93584.zip
tcl-1dc34345abbeeb394c746abc809889b36af93584.tar.gz
tcl-1dc34345abbeeb394c746abc809889b36af93584.tar.bz2
rename static function FSUnloadTempFile to
TclFSUnloadTempFile, needed in tclLoad.c Fixed [Bug 2269431]: load of shared objects leaves temporary files on windows
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIOUtil.c16
-rw-r--r--generic/tclInt.h3
-rw-r--r--generic/tclLoad.c11
3 files changed, 14 insertions, 16 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 077eb96..607397e 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -17,7 +17,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIOUtil.c,v 1.158 2008/10/05 22:25:35 nijtmans Exp $
+ * RCS: @(#) $Id: tclIOUtil.c,v 1.159 2008/11/13 22:34:33 nijtmans Exp $
*/
#include "tclInt.h"
@@ -192,12 +192,6 @@ TCL_DECLARE_MUTEX(cwdMutex)
Tcl_ThreadDataKey tclFsDataKey;
/*
- * Declare fallback support function and information for Tcl_FSLoadFile
- */
-
-static Tcl_FSUnloadFileProc FSUnloadTempFile;
-
-/*
* One of these structures is used each time we successfully load a file from
* a file system by way of making a temporary copy of the file on the native
* filesystem. We need to store both the actual unloadProc/clientData
@@ -3187,7 +3181,7 @@ TclLoadFile(
copyToPtr = NULL;
*handlePtr = newLoadHandle;
*clientDataPtr = tvdlPtr;
- *unloadProcPtr = &FSUnloadTempFile;
+ *unloadProcPtr = TclFSUnloadTempFile;
Tcl_ResetResult(interp);
return retVal;
@@ -3252,7 +3246,7 @@ TclpLoadFile(
/*
*---------------------------------------------------------------------------
*
- * FSUnloadTempFile --
+ * TclFSUnloadTempFile --
*
* This function is called when we loaded a library of code via an
* intermediate temporary file. This function ensures the library is
@@ -3268,8 +3262,8 @@ TclpLoadFile(
*---------------------------------------------------------------------------
*/
-static void
-FSUnloadTempFile(
+void
+TclFSUnloadTempFile(
Tcl_LoadHandle loadHandle) /* loadHandle returned by a previous call to
* Tcl_FSLoadFile(). The loadHandle is a token
* that represents the loaded file. */
diff --git a/generic/tclInt.h b/generic/tclInt.h
index f0c922f..027e93e 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -15,7 +15,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.405 2008/11/07 20:10:19 patthoyts Exp $
+ * RCS: @(#) $Id: tclInt.h,v 1.406 2008/11/13 22:34:33 nijtmans Exp $
*/
#ifndef _TCLINT
@@ -2642,6 +2642,7 @@ MODULE_SCOPE double TclFloor(mp_int *a);
MODULE_SCOPE void TclFormatNaN(double value, char *buffer);
MODULE_SCOPE int TclFSFileAttrIndex(Tcl_Obj *pathPtr,
const char *attributeName, int *indexPtr);
+MODULE_SCOPE void TclFSUnloadTempFile(Tcl_LoadHandle loadHandle);
MODULE_SCOPE int * TclGetAsyncReadyPtr(void);
MODULE_SCOPE Tcl_Obj * TclGetBgErrorHandler(Tcl_Interp *interp);
MODULE_SCOPE int TclGetChannelFromObj(Tcl_Interp *interp,
diff --git a/generic/tclLoad.c b/generic/tclLoad.c
index 36a61b0..c2a677b 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.20 2008/10/16 22:34:18 nijtmans Exp $
+ * RCS: @(#) $Id: tclLoad.c,v 1.21 2008/11/13 22:34:33 nijtmans Exp $
*/
#include "tclInt.h"
@@ -791,7 +791,7 @@ Tcl_UnloadObjCmd(
if (unLoadProcPtr != NULL) {
Tcl_MutexLock(&packageMutex);
- if (pkgPtr->unloadProc != NULL) {
+ if ((pkgPtr->unloadProc != NULL) || (unLoadProcPtr == TclFSUnloadTempFile)) {
unLoadProcPtr(pkgPtr->loadHandle);
}
@@ -1146,8 +1146,11 @@ TclFinalizeLoad(void)
*/
if (pkgPtr->fileName[0] != '\0') {
- if ((pkgPtr->unLoadProcPtr != NULL) && (pkgPtr->unloadProc != NULL)) {
- pkgPtr->unLoadProcPtr(pkgPtr->loadHandle);
+ Tcl_FSUnloadFileProc *unLoadProcPtr = pkgPtr->unLoadProcPtr;
+ if ((unLoadProcPtr != NULL)
+ && ((pkgPtr->unloadProc != NULL)
+ || (unLoadProcPtr == TclFSUnloadTempFile))) {
+ unLoadProcPtr(pkgPtr->loadHandle);
}
}
#endif