diff options
author | sebres <sebres@users.sourceforge.net> | 2014-04-22 13:25:41 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2014-04-22 13:25:41 (GMT) |
commit | 192fce9c01c4ee3827aa8f54967764c18bdd5dca (patch) | |
tree | 8c753402e4e14c2e9ce0d04c5bb6ef9ed65b565f /generic/tclThreadAlloc.c | |
parent | a07adf4d6d28771d9aa74ef06526e5fb3035f5c1 (diff) | |
download | tcl-192fce9c01c4ee3827aa8f54967764c18bdd5dca.zip tcl-192fce9c01c4ee3827aa8f54967764c18bdd5dca.tar.gz tcl-192fce9c01c4ee3827aa8f54967764c18bdd5dca.tar.bz2 |
Memory leak after thread exit, fixed (alloc cache released by exit), belong to ticket [3493120]
Moved over to branch bug-3493120. This is not ready
for the core-8-5-branch. Segfaults all over the place
in a thread-enabled build on a CentOS system.
Diffstat (limited to 'generic/tclThreadAlloc.c')
-rw-r--r-- | generic/tclThreadAlloc.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/generic/tclThreadAlloc.c b/generic/tclThreadAlloc.c index 2e74fa7..106e908 100644 --- a/generic/tclThreadAlloc.c +++ b/generic/tclThreadAlloc.c @@ -1012,6 +1012,33 @@ TclFinalizeThreadAlloc(void) TclpFreeAllocCache(NULL); } +/* + *---------------------------------------------------------------------- + * + * TclFinalizeThreadAllocThread -- + * + * This procedure is used to destroy single thread private resources used + * in this file. + * Called in TclpFinalizeThreadData when a thread exits (Tcl_FinalizeThread). + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +TclFinalizeThreadAllocThread(void) +{ + Cache *cachePtr = TclpGetAllocCache(); + if (cachePtr != NULL) { + TclpFreeAllocCache(cachePtr); + } +} + #else /* !(TCL_THREADS && USE_THREAD_ALLOC) */ /* *---------------------------------------------------------------------- |