diff options
author | dgp <dgp@users.sourceforge.net> | 2014-04-24 04:34:01 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-04-24 04:34:01 (GMT) |
commit | 5b5f0209a4f6007ff2804da3f32258bb2148e814 (patch) | |
tree | 7c825dbeded76cc60fc9770c7f9d97f008323262 /generic/tclThreadAlloc.c | |
parent | 333fb43fbfb982a67285d944fe45a42dc8f85913 (diff) | |
parent | fe4debabde73db9d51c655f61d19bc8d23956668 (diff) | |
download | tcl-5b5f0209a4f6007ff2804da3f32258bb2148e814.zip tcl-5b5f0209a4f6007ff2804da3f32258bb2148e814.tar.gz tcl-5b5f0209a4f6007ff2804da3f32258bb2148e814.tar.bz2 |
[3493120] Plug memory leak in thread exit.
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 abd5af5..ddf888a 100644 --- a/generic/tclThreadAlloc.c +++ b/generic/tclThreadAlloc.c @@ -1023,6 +1023,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) */ /* *---------------------------------------------------------------------- |