diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-10-11 21:43:44 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-10-11 21:43:44 (GMT) |
commit | ec38e8f25d1ab36067c04af2aa06d435602308e4 (patch) | |
tree | 6ec54166e1a86a7d7a558c818ffc68b1a294cad1 /unix | |
parent | 9f28b1c889739c3e581ed0a686ade9fbc94dcce5 (diff) | |
parent | bde664806c7d9a27db5bc4487bb927da83ed67d7 (diff) | |
download | tcl-ec38e8f25d1ab36067c04af2aa06d435602308e4.zip tcl-ec38e8f25d1ab36067c04af2aa06d435602308e4.tar.gz tcl-ec38e8f25d1ab36067c04af2aa06d435602308e4.tar.bz2 |
Fix [3cc1d91345]: duplicate calls to TclpFreeAllocCache() on thread exists
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tclUnixInit.c | 2 | ||||
-rw-r--r-- | unix/tclUnixThrd.c | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 5fc0035..badfb36 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -769,7 +769,7 @@ TclpSetVariables( CFLocaleRef localeRef; - if (CFLocaleCopyCurrent != NULL && CFLocaleGetIdentifier != NULL && + if (&CFLocaleCopyCurrent != NULL && &CFLocaleGetIdentifier != NULL && (localeRef = CFLocaleCopyCurrent())) { CFStringRef locale = CFLocaleGetIdentifier(localeRef); diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index ea03332..9757e4e 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -722,7 +722,8 @@ TclpFreeAllocCache( { if (ptr != NULL) { /* - * Called by the pthread lib when a thread exits + * Called by TclFinalizeThreadAllocThread() during the thread + * finalization initiated from Tcl_FinalizeThread() */ TclFreeAllocCache(ptr); @@ -730,7 +731,7 @@ TclpFreeAllocCache( } else if (initialized) { /* - * Called by us in TclFinalizeThreadAlloc() during the library + * Called by TclFinalizeThreadAlloc() during the process * finalization initiated from Tcl_Finalize() */ @@ -745,7 +746,7 @@ TclpGetAllocCache(void) if (!initialized) { pthread_mutex_lock(allocLockPtr); if (!initialized) { - pthread_key_create(&key, TclpFreeAllocCache); + pthread_key_create(&key, NULL); initialized = 1; } pthread_mutex_unlock(allocLockPtr); |