comparison src/misc2.c @ 9169:0ea97a753a2d v7.4.1868

commit https://github.com/vim/vim/commit/b89a25f17e274dc308c584ea69a129ffbb26bc3d Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jun 1 23:08:39 2016 +0200 patch 7.4.1868 Problem: Setting really_exiting causes memory leaks to be reported. Solution: Add the in_free_all_mem flag.
author Christian Brabandt <cb@256bit.org>
date Wed, 01 Jun 2016 23:15:06 +0200
parents 062eb6d28b0c
children c25898cc99c1
comparison
equal deleted inserted replaced
9168:702732dc3ed7 9169:0ea97a753a2d
1034 */ 1034 */
1035 void 1035 void
1036 free_all_mem(void) 1036 free_all_mem(void)
1037 { 1037 {
1038 buf_T *buf, *nextbuf; 1038 buf_T *buf, *nextbuf;
1039 static int entered = FALSE;
1040 1039
1041 /* When we cause a crash here it is caught and Vim tries to exit cleanly. 1040 /* When we cause a crash here it is caught and Vim tries to exit cleanly.
1042 * Don't try freeing everything again. */ 1041 * Don't try freeing everything again. */
1043 if (entered) 1042 if (entered_free_all_mem)
1044 return; 1043 return;
1045 entered = TRUE; 1044 entered_free_all_mem = TRUE;
1046
1047 /* Set this flag to indicate some errors can be ignored. */
1048 really_exiting = TRUE;
1049 1045
1050 # ifdef FEAT_AUTOCMD 1046 # ifdef FEAT_AUTOCMD
1051 /* Don't want to trigger autocommands from here on. */ 1047 /* Don't want to trigger autocommands from here on. */
1052 block_autocmds(); 1048 block_autocmds();
1053 # endif 1049 # endif