diff src/eval.c @ 16967:586d625e21b4 v8.1.1484

patch 8.1.1484: some tests are slow commit https://github.com/vim/vim/commit/75ee544f99ca66be8105570c6309d95435ad30d1 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 6 18:05:25 2019 +0200 patch 8.1.1484: some tests are slow Problem: Some tests are slow. Solution: Add timing to the test messages. Fix double free when quitting in VimLeavePre autocmd.
author Bram Moolenaar <Bram@vim.org>
date Thu, 06 Jun 2019 18:15:05 +0200
parents a836d122231a
children 8c794a694d66
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -430,11 +430,12 @@ eval_clear(void)
 	vim_free(SCRIPT_SV(i));
     ga_clear(&ga_scripts);
 
-    /* unreferenced lists and dicts */
+    // functions need to be freed before gargabe collecting, otherwise local
+    // variables might be freed twice.
+    free_all_functions();
+
+    // unreferenced lists and dicts
     (void)garbage_collect(FALSE);
-
-    /* functions */
-    free_all_functions();
 }
 #endif