]> granicus.if.org Git - vim/commitdiff
patch 8.2.4126: crash on exit when built with dynamic Tcl v8.2.4126
authorBram Moolenaar <Bram@vim.org>
Mon, 17 Jan 2022 21:34:38 +0000 (21:34 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 17 Jan 2022 21:34:38 +0000 (21:34 +0000)
Problem:    Crash on exit when built with dynamic Tcl and EXITFREE is defined.
            (Dominique PellĂ©)
Solution:   Only call Tcl_Finalize() when initialized. (closes #9546)

src/if_tcl.c
src/version.c

index 75f904a9ef9c8179d005dcae17fabe9920e27827..f66bfd3860db890e9a6aa5c5d93231c929a47b2b 100644 (file)
@@ -248,14 +248,6 @@ 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;
@@ -285,6 +277,17 @@ tcl_enabled(int verbose)
     }
     return stubs_initialized;
 }
+#endif
+
+#if defined(EXITFREE) || defined(PROTO)
+    void
+vim_tcl_finalize(void)
+{
+# ifdef DYNAMIC_TCL
+    if (stubs_initialized)
+# endif
+       Tcl_Finalize();
+}
 #endif
 
     void
index 735b8f6f81e515da1291bce9c245fe1b7ce9e0d9..6fb6181da2ce857a5336f4a0c260d4dd006fe060 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4126,
 /**/
     4125,
 /**/