]> granicus.if.org Git - vim/commitdiff
patch 8.2.3740: memory left allocated on exit when using Tcl v8.2.3740
authorBram Moolenaar <Bram@vim.org>
Sun, 5 Dec 2021 11:36:23 +0000 (11:36 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 5 Dec 2021 11:36:23 +0000 (11:36 +0000)
Problem:    Memory left allocated on exit when using Tcl.
Solution:   Call Tcl_Finalize().

src/alloc.c
src/if_tcl.c
src/proto/if_tcl.pro
src/version.c

index 38b452cbe2e3cccc09df6693305f3d2107aca503..84a1124f357a95bdd4eebda73292a289ee932dce 100644 (file)
@@ -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();
 
index f3f4b0798a46db85877017640391230c687925c8..4838e3197691be54e5ebda364883976e9c2f25e0 100644 (file)
@@ -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;
index b572fb84caf9694d5bd597403f694349fbced1da..11ca7a20ead0a221c325c1c364ebb9816f4be37e 100644 (file)
@@ -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);
index 338b8a4ad4046549cba341796d007784a07d85db..6e1e30aa9870f94ff636534d4c2fcdbdbb16dd4d 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3740,
 /**/
     3739,
 /**/