summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2002-08-29 19:02:19 (GMT)
committerandreas_kupries <akupries@shaw.ca>2002-08-29 19:02:19 (GMT)
commit6f97e75f52281eb769d51f15d7e07c3cd935a4d3 (patch)
treedbafde4aa9f84ef11634a572b7a66e5a0487edf2 /win
parentcaec85ff53d666eba22542cef6c31014e4f0022e (diff)
downloadtcl-6f97e75f52281eb769d51f15d7e07c3cd935a4d3.zip
tcl-6f97e75f52281eb769d51f15d7e07c3cd935a4d3.tar.gz
tcl-6f97e75f52281eb769d51f15d7e07c3cd935a4d3.tar.bz2
* win/tclWinThrd.c (TclpFinalizeThreadData, TclWinFreeAllocCache):macosx_8_4_premerge_2002_08_31_trunkmacosx_8_4_merge_2002_08_30_trunk
Applied patch for bug #599428, provided by Miguel Sofer <msofer@users.sourceforge.net>.
Diffstat (limited to 'win')
-rw-r--r--win/tclWinThrd.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c
index 10a886c..a00c672 100644
--- a/win/tclWinThrd.c
+++ b/win/tclWinThrd.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: tclWinThrd.c,v 1.19 2002/04/23 17:03:35 hobbs Exp $
+ * RCS: @(#) $Id: tclWinThrd.c,v 1.20 2002/08/29 19:02:19 andreas_kupries Exp $
*/
#include "tclWinInt.h"
@@ -633,15 +633,10 @@ TclpFinalizeThreadData(keyPtr)
{
VOID *result;
DWORD *indexPtr;
-#ifdef USE_THREAD_ALLOC
- static int once = 0;
- if (!once) {
- once = 1;
- TclWinFreeAllocCache();
- }
+#ifdef USE_THREAD_ALLOC
+ TclWinFreeAllocCache();
#endif
-
if (*keyPtr != NULL) {
indexPtr = *(DWORD **)keyPtr;
result = (VOID *)TlsGetValue(*indexPtr);
@@ -1039,8 +1034,10 @@ TclWinFreeAllocCache(void)
void *ptr;
ptr = TlsGetValue(key);
- TlsSetValue(key, NULL);
- TclFreeAllocCache(ptr);
+ if (ptr != NULL) {
+ TlsSetValue(key, NULL);
+ TclFreeAllocCache(ptr);
+ }
}
#endif /* USE_THREAD_ALLOC */