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 | 3ec273770b6c93b8a1281ba9412eda19ac3d3184 (patch) | |
tree | 7c825dbeded76cc60fc9770c7f9d97f008323262 /generic/tclThreadAlloc.c | |
parent | af15fe284aa109259d33de36b92752494e67fa73 (diff) | |
parent | c69e73e1839416633daa84c608f5ae36091275ba (diff) | |
download | tcl-3ec273770b6c93b8a1281ba9412eda19ac3d3184.zip tcl-3ec273770b6c93b8a1281ba9412eda19ac3d3184.tar.gz tcl-3ec273770b6c93b8a1281ba9412eda19ac3d3184.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) */ /* *---------------------------------------------------------------------- |