diff options
| author | dgp <dgp@users.sourceforge.net> | 2014-04-23 18:25:27 (GMT) |
|---|---|---|
| committer | dgp <dgp@users.sourceforge.net> | 2014-04-23 18:25:27 (GMT) |
| commit | c69e73e1839416633daa84c608f5ae36091275ba (patch) | |
| tree | 8b77f40dadcc9f07791387401ab293f6213d6fff /generic/tclThreadAlloc.c | |
| parent | d7f092d1cff5607b7a1c7ccc0199667091bfd69e (diff) | |
| parent | fa12c3782debade5f7f7c6611cf250b8580759c2 (diff) | |
| download | tcl-c69e73e1839416633daa84c608f5ae36091275ba.zip tcl-c69e73e1839416633daa84c608f5ae36091275ba.tar.gz tcl-c69e73e1839416633daa84c608f5ae36091275ba.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 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) */ /* *---------------------------------------------------------------------- |
