Mercurial > vim
comparison src/ex_docmd.c @ 11635:70bc7b107610 v8.0.0700
patch 8.0.0700: segfault with QuitPre autocommand closes the window
commit https://github.com/vim/vim/commit/0ea5070d79c8a13fb2403280a72f968495b0fab7
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 8 14:44:50 2017 +0200
patch 8.0.0700: segfault with QuitPre autocommand closes the window
Problem: Segfault with QuitPre autocommand closes the window. (Marek)
Solution: Check that the window pointer is still valid. (Christian Brabandt,
closes #1817)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 08 Jul 2017 14:45:03 +0200 |
parents | b8299e742f41 |
children | 74abb6c84984 |
comparison
equal
deleted
inserted
replaced
11634:5f7d69dca4ec | 11635:70bc7b107610 |
---|---|
7269 | 7269 |
7270 #ifdef FEAT_AUTOCMD | 7270 #ifdef FEAT_AUTOCMD |
7271 apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf); | 7271 apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf); |
7272 /* Refuse to quit when locked or when the buffer in the last window is | 7272 /* Refuse to quit when locked or when the buffer in the last window is |
7273 * being closed (can only happen in autocommands). */ | 7273 * being closed (can only happen in autocommands). */ |
7274 if (curbuf_locked() || (wp->w_buffer->b_nwindows == 1 | 7274 if (curbuf_locked() |
7275 && wp->w_buffer->b_locked > 0)) | 7275 # ifdef FEAT_WINDOWS |
7276 || !win_valid(wp) | |
7277 # endif | |
7278 || (wp->w_buffer->b_nwindows == 1 && wp->w_buffer->b_locked > 0)) | |
7276 return; | 7279 return; |
7277 #endif | 7280 #endif |
7278 | 7281 |
7279 #ifdef FEAT_NETBEANS_INTG | 7282 #ifdef FEAT_NETBEANS_INTG |
7280 netbeansForcedQuit = eap->forceit; | 7283 netbeansForcedQuit = eap->forceit; |