Skip to content

Commit

Permalink
patch 8.2.3740: memory left allocated on exit when using Tcl
Browse files Browse the repository at this point in the history
Problem:    Memory left allocated on exit when using Tcl.
Solution:   Call Tcl_Finalize().
  • Loading branch information
brammool committed Dec 5, 2021
1 parent dea4a61 commit c7269f8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/alloc.c
Expand Up @@ -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();

Expand Down
8 changes: 8 additions & 0 deletions src/if_tcl.c
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions 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);
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -753,6 +753,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3740,
/**/
3739,
/**/
Expand Down

0 comments on commit c7269f8

Please sign in to comment.