diff src/eval.c @ 1405:b63792dadc23 v7.1.120

updated for version 7.1-120
author vimboss
date Tue, 25 Sep 2007 16:00:00 +0000
parents 004eb98eb3c3
children 396a9b65abe6
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -6128,6 +6128,7 @@ garbage_collect()
     /* Only do this once. */
     want_garbage_collect = FALSE;
     may_garbage_collect = FALSE;
+    garbage_collect_at_exit = FALSE;
 
     /*
      * 1. Go through all accessible variables and mark all lists and dicts
@@ -7110,7 +7111,7 @@ static struct fst
     {"foldtextresult",	1, 1, f_foldtextresult},
     {"foreground",	0, 0, f_foreground},
     {"function",	1, 1, f_function},
-    {"garbagecollect",	0, 0, f_garbagecollect},
+    {"garbagecollect",	0, 1, f_garbagecollect},
     {"get",		2, 3, f_get},
     {"getbufline",	2, 3, f_getbufline},
     {"getbufvar",	2, 2, f_getbufvar},
@@ -9719,6 +9720,9 @@ f_garbagecollect(argvars, rettv)
     /* This is postponed until we are back at the toplevel, because we may be
      * using Lists and Dicts internally.  E.g.: ":echo [garbagecollect()]". */
     want_garbage_collect = TRUE;
+
+    if (argvars[0].v_type != VAR_UNKNOWN && get_tv_number(&argvars[0]) == 1)
+	garbage_collect_at_exit = TRUE;
 }
 
 /*