diff options
| author | Eli Zaretskii | 2013-07-28 18:22:27 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2013-07-28 18:22:27 +0300 |
| commit | 2e5ce5ded73aa084e12b826fd1adbebd03f900fd (patch) | |
| tree | 78668c3c8e48cca16e57b6005c45543ae5b6b80f | |
| parent | 0f91f03c05dd9be6dbcb7eecd784ccaf0fc7a24b (diff) | |
| download | emacs-2e5ce5ded73aa084e12b826fd1adbebd03f900fd.tar.gz emacs-2e5ce5ded73aa084e12b826fd1adbebd03f900fd.zip | |
Fix bug #14970 with crashes when deleting many frames on MS-Windows.
src/w32fns.c (w32_wnd_proc) <WM_IME_STARTCOMPOSITION>: Make sure the
frame which got the message is still alive, before dereferencing
its pointer.
src/frame.c (delete_frame): Test "this" frame's minibuffer window to
be a live window, before using it as such.
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/frame.c | 9 | ||||
| -rw-r--r-- | src/w32fns.c | 2 |
3 files changed, 17 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 95fdd2da94e..c5448fd1514 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2013-07-28 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * w32fns.c (w32_wnd_proc) <WM_IME_STARTCOMPOSITION>: Make sure the | ||
| 4 | frame which got the message is still alive, before dereferencing | ||
| 5 | its pointer. (Bug#14970) | ||
| 6 | |||
| 7 | * frame.c (delete_frame): Test "this" frame's minibuffer window to | ||
| 8 | be a live window, before using it as such. (Bug#14970) | ||
| 9 | |||
| 1 | 2013-07-27 Eli Zaretskii <eliz@gnu.org> | 10 | 2013-07-27 Eli Zaretskii <eliz@gnu.org> |
| 2 | 11 | ||
| 3 | * w32term.c (w32_read_socket) <WM_KILLFOCUS>: Call | 12 | * w32term.c (w32_read_socket) <WM_KILLFOCUS>: Call |
diff --git a/src/frame.c b/src/frame.c index 5fa54052cd2..0b59b43a445 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -1157,10 +1157,13 @@ delete_frame (Lisp_Object frame, Lisp_Object force) | |||
| 1157 | 1157 | ||
| 1158 | FOR_EACH_FRAME (frames, this) | 1158 | FOR_EACH_FRAME (frames, this) |
| 1159 | { | 1159 | { |
| 1160 | Lisp_Object fminiw; | ||
| 1161 | struct frame *this_f; | ||
| 1162 | |||
| 1160 | if (! EQ (this, frame) | 1163 | if (! EQ (this, frame) |
| 1161 | && EQ (frame, | 1164 | && (this_f = XFRAME (this)) |
| 1162 | WINDOW_FRAME (XWINDOW | 1165 | && WINDOWP (fminiw = FRAME_MINIBUF_WINDOW (this_f)) |
| 1163 | (FRAME_MINIBUF_WINDOW (XFRAME (this)))))) | 1166 | && EQ (frame, WINDOW_FRAME (XWINDOW (fminiw)))) |
| 1164 | { | 1167 | { |
| 1165 | /* If we MUST delete this frame, delete the other first. | 1168 | /* If we MUST delete this frame, delete the other first. |
| 1166 | But do this only if FORCE equals `noelisp'. */ | 1169 | But do this only if FORCE equals `noelisp'. */ |
diff --git a/src/w32fns.c b/src/w32fns.c index 675b716f3b0..2b06936d119 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -3213,6 +3213,8 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) | |||
| 3213 | described by W was deleted, as indicated by its buffer | 3213 | described by W was deleted, as indicated by its buffer |
| 3214 | field being reset to nil. */ | 3214 | field being reset to nil. */ |
| 3215 | f = x_window_to_frame (dpyinfo, hwnd); | 3215 | f = x_window_to_frame (dpyinfo, hwnd); |
| 3216 | if (!(f && FRAME_LIVE_P (f))) | ||
| 3217 | break; | ||
| 3216 | w = XWINDOW (FRAME_SELECTED_WINDOW (f)); | 3218 | w = XWINDOW (FRAME_SELECTED_WINDOW (f)); |
| 3217 | /* Punt if someone changed the frame's selected window | 3219 | /* Punt if someone changed the frame's selected window |
| 3218 | behind our back. */ | 3220 | behind our back. */ |