# HG changeset patch # User Bram Moolenaar # Date 1642455904 -3600 # Node ID 005ebb9c8b8f84738b288efb25edac0fa458e7fb # Parent 421d345d0189e53d9829379573006fccd59b48d8 patch 8.2.4126: crash on exit when built with dynamic Tcl Commit: https://github.com/vim/vim/commit/afa76e1cf2e7e1f9e1097e345a4272e9ddbf14ad Author: Bram Moolenaar Date: Mon Jan 17 21:34:38 2022 +0000 patch 8.2.4126: crash on exit when built with dynamic Tcl Problem: Crash on exit when built with dynamic Tcl and EXITFREE is defined. (Dominique Pell?) Solution: Only call Tcl_Finalize() when initialized. (closes #9546) diff --git a/src/if_tcl.c b/src/if_tcl.c --- a/src/if_tcl.c +++ b/src/if_tcl.c @@ -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; @@ -287,6 +279,17 @@ tcl_enabled(int verbose) } #endif +#if defined(EXITFREE) || defined(PROTO) + void +vim_tcl_finalize(void) +{ +# ifdef DYNAMIC_TCL + if (stubs_initialized) +# endif + Tcl_Finalize(); +} +#endif + void tcl_end(void) { diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4126, +/**/ 4125, /**/ 4124,