summaryrefslogtreecommitdiffstats
path: root/generic/tclThreadAlloc.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-04-24 04:34:01 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-04-24 04:34:01 (GMT)
commit5b5f0209a4f6007ff2804da3f32258bb2148e814 (patch)
tree7c825dbeded76cc60fc9770c7f9d97f008323262 /generic/tclThreadAlloc.c
parent333fb43fbfb982a67285d944fe45a42dc8f85913 (diff)
parentfe4debabde73db9d51c655f61d19bc8d23956668 (diff)
downloadtcl-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.c27
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) */
/*
*----------------------------------------------------------------------