diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-17 21:34:38 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-17 21:34:38 +0000 |
commit | afa76e1cf2e7e1f9e1097e345a4272e9ddbf14ad (patch) | |
tree | 91f2db425f26ca3daaee7ab960a61a96f0795007 /src/if_tcl.c | |
parent | b3d9ceed2bc96acb7a2388e138559df6282118af (diff) |
patch 8.2.4126: crash on exit when built with dynamic Tclv8.2.4126
Problem: Crash on exit when built with dynamic Tcl and EXITFREE is defined.
(Dominique Pellé)
Solution: Only call Tcl_Finalize() when initialized. (closes #9546)
Diffstat (limited to 'src/if_tcl.c')
-rw-r--r-- | src/if_tcl.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/if_tcl.c b/src/if_tcl.c index 75f904a9ef..f66bfd3860 100644 --- 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) { |