From c7269f862748c3b0f56b5a651019e18c7d5190ee Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 5 Dec 2021 11:36:23 +0000 Subject: patch 8.2.3740: memory left allocated on exit when using Tcl Problem: Memory left allocated on exit when using Tcl. Solution: Call Tcl_Finalize(). --- src/alloc.c | 3 +++ src/if_tcl.c | 8 ++++++++ src/proto/if_tcl.pro | 1 + src/version.c | 2 ++ 4 files changed, 14 insertions(+) diff --git a/src/alloc.c b/src/alloc.c index 38b452cbe2..84a1124f35 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -573,6 +573,9 @@ free_all_mem(void) # endif # ifdef FEAT_GUI_GTK gui_mch_free_all(); +# endif +# ifdef FEAT_TCL + vim_tcl_finalize(); # endif clear_hl_tables(); diff --git a/src/if_tcl.c b/src/if_tcl.c index f3f4b0798a..4838e31976 100644 --- a/src/if_tcl.c +++ b/src/if_tcl.c @@ -248,6 +248,14 @@ vim_tcl_init(char *arg) #endif } +#if defined(EXITFREE) || defined(PROTO) + void +vim_tcl_finalize(void) +{ + Tcl_Finalize(); +} +#endif + #if defined(DYNAMIC_TCL) || defined(PROTO) static int stubs_initialized = FALSE; diff --git a/src/proto/if_tcl.pro b/src/proto/if_tcl.pro index b572fb84ca..11ca7a20ea 100644 --- a/src/proto/if_tcl.pro +++ b/src/proto/if_tcl.pro @@ -1,5 +1,6 @@ /* if_tcl.c */ void vim_tcl_init(char *arg); +void vim_tcl_finalize(void); int tcl_enabled(int verbose); void tcl_end(void); void ex_tcl(exarg_T *eap); diff --git a/src/version.c b/src/version.c index 338b8a4ad4..6e1e30aa98 100644 --- a/src/version.c +++ b/src/version.c @@ -753,6 +753,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 3740, /**/ 3739, /**/ -- cgit v1.2.3