comparison src/misc1.c @ 5338:965044860b7f v7.4.022

updated for version 7.4.022 Problem: Deadlock while exiting, because of allocating memory. Solution: Do not use gettext() in deathtrap(). (James McCoy)
author Bram Moolenaar <bram@vim.org>
date Thu, 05 Sep 2013 21:41:39 +0200
parents 3ddec3d25bd1
children b9c1c1f4cda9
comparison
equal deleted inserted replaced
5337:09ecbbbdee62 5338:965044860b7f
9172 } 9172 }
9173 9173
9174 /* 9174 /*
9175 * Preserve files and exit. 9175 * Preserve files and exit.
9176 * When called IObuff must contain a message. 9176 * When called IObuff must contain a message.
9177 * NOTE: This may be called from deathtrap() in a signal handler, avoid unsafe
9178 * functions, such as allocating memory.
9177 */ 9179 */
9178 void 9180 void
9179 preserve_exit() 9181 preserve_exit()
9180 { 9182 {
9181 buf_T *buf; 9183 buf_T *buf;
9194 9196
9195 for (buf = firstbuf; buf != NULL; buf = buf->b_next) 9197 for (buf = firstbuf; buf != NULL; buf = buf->b_next)
9196 { 9198 {
9197 if (buf->b_ml.ml_mfp != NULL && buf->b_ml.ml_mfp->mf_fname != NULL) 9199 if (buf->b_ml.ml_mfp != NULL && buf->b_ml.ml_mfp->mf_fname != NULL)
9198 { 9200 {
9199 OUT_STR(_("Vim: preserving files...\n")); 9201 OUT_STR("Vim: preserving files...\n");
9200 screen_start(); /* don't know where cursor is now */ 9202 screen_start(); /* don't know where cursor is now */
9201 out_flush(); 9203 out_flush();
9202 ml_sync_all(FALSE, FALSE); /* preserve all swap files */ 9204 ml_sync_all(FALSE, FALSE); /* preserve all swap files */
9203 break; 9205 break;
9204 } 9206 }
9205 } 9207 }
9206 9208
9207 ml_close_all(FALSE); /* close all memfiles, without deleting */ 9209 ml_close_all(FALSE); /* close all memfiles, without deleting */
9208 9210
9209 OUT_STR(_("Vim: Finished.\n")); 9211 OUT_STR("Vim: Finished.\n");
9210 9212
9211 getout(1); 9213 getout(1);
9212 } 9214 }
9213 9215
9214 /* 9216 /*