Mercurial > vim
comparison src/misc2.c @ 14658:9ffd7d0650c6 v8.1.0342
patch 8.1.0342: crash when a callback deletes a window that is being used
commit https://github.com/vim/vim/commit/94f01956a583223dafe24135489d0ab1100ab0ad
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 1 15:30:03 2018 +0200
patch 8.1.0342: crash when a callback deletes a window that is being used
Problem: Crash when a callback deletes a window that is being used.
Solution: Do not unload a buffer that is being displayed while redrawing the
screen. Also avoid invoking callbacks while redrawing.
(closes #2107)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 01 Sep 2018 15:45:05 +0200 |
parents | 0a69e6e708f9 |
children | 27b9a84395b5 |
comparison
equal
deleted
inserted
replaced
14657:1f979ad27ab5 | 14658:9ffd7d0650c6 |
---|---|
6364 void | 6364 void |
6365 parse_queued_messages(void) | 6365 parse_queued_messages(void) |
6366 { | 6366 { |
6367 win_T *old_curwin = curwin; | 6367 win_T *old_curwin = curwin; |
6368 | 6368 |
6369 /* For Win32 mch_breakcheck() does not check for input, do it here. */ | 6369 // Do not handle messages while redrawing, because it may cause buffers to |
6370 // change or be wiped while they are being redrawn. | |
6371 if (updating_screen) | |
6372 return; | |
6373 | |
6374 // For Win32 mch_breakcheck() does not check for input, do it here. | |
6370 # if defined(WIN32) && defined(FEAT_JOB_CHANNEL) | 6375 # if defined(WIN32) && defined(FEAT_JOB_CHANNEL) |
6371 channel_handle_events(FALSE); | 6376 channel_handle_events(FALSE); |
6372 # endif | 6377 # endif |
6373 | 6378 |
6374 # ifdef FEAT_NETBEANS_INTG | 6379 # ifdef FEAT_NETBEANS_INTG |
6375 /* Process the queued netbeans messages. */ | 6380 // Process the queued netbeans messages. |
6376 netbeans_parse_messages(); | 6381 netbeans_parse_messages(); |
6377 # endif | 6382 # endif |
6378 # ifdef FEAT_JOB_CHANNEL | 6383 # ifdef FEAT_JOB_CHANNEL |
6379 /* Write any buffer lines still to be written. */ | 6384 // Write any buffer lines still to be written. |
6380 channel_write_any_lines(); | 6385 channel_write_any_lines(); |
6381 | 6386 |
6382 /* Process the messages queued on channels. */ | 6387 // Process the messages queued on channels. |
6383 channel_parse_messages(); | 6388 channel_parse_messages(); |
6384 # endif | 6389 # endif |
6385 # if defined(FEAT_CLIENTSERVER) && defined(FEAT_X11) | 6390 # if defined(FEAT_CLIENTSERVER) && defined(FEAT_X11) |
6386 /* Process the queued clientserver messages. */ | 6391 // Process the queued clientserver messages. |
6387 server_parse_messages(); | 6392 server_parse_messages(); |
6388 # endif | 6393 # endif |
6389 # ifdef FEAT_JOB_CHANNEL | 6394 # ifdef FEAT_JOB_CHANNEL |
6390 /* Check if any jobs have ended. */ | 6395 // Check if any jobs have ended. |
6391 job_check_ended(); | 6396 job_check_ended(); |
6392 # endif | 6397 # endif |
6393 | 6398 |
6394 /* If the current window changed we need to bail out of the waiting loop. | 6399 // If the current window changed we need to bail out of the waiting loop. |
6395 * E.g. when a job exit callback closes the terminal window. */ | 6400 // E.g. when a job exit callback closes the terminal window. |
6396 if (curwin != old_curwin) | 6401 if (curwin != old_curwin) |
6397 ins_char_typebuf(K_IGNORE); | 6402 ins_char_typebuf(K_IGNORE); |
6398 } | 6403 } |
6399 #endif | 6404 #endif |
6400 | 6405 |