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.
This commit is contained in:
Eli Zaretskii 2013-07-28 18:22:27 +03:00
parent 0f91f03c05
commit 2e5ce5ded7
3 changed files with 17 additions and 3 deletions

View file

@ -1,3 +1,12 @@
2013-07-28 Eli Zaretskii <eliz@gnu.org>
* w32fns.c (w32_wnd_proc) <WM_IME_STARTCOMPOSITION>: Make sure the
frame which got the message is still alive, before dereferencing
its pointer. (Bug#14970)
* frame.c (delete_frame): Test "this" frame's minibuffer window to
be a live window, before using it as such. (Bug#14970)
2013-07-27 Eli Zaretskii <eliz@gnu.org>
* w32term.c (w32_read_socket) <WM_KILLFOCUS>: Call

View file

@ -1157,10 +1157,13 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
FOR_EACH_FRAME (frames, this)
{
Lisp_Object fminiw;
struct frame *this_f;
if (! EQ (this, frame)
&& EQ (frame,
WINDOW_FRAME (XWINDOW
(FRAME_MINIBUF_WINDOW (XFRAME (this))))))
&& (this_f = XFRAME (this))
&& WINDOWP (fminiw = FRAME_MINIBUF_WINDOW (this_f))
&& EQ (frame, WINDOW_FRAME (XWINDOW (fminiw))))
{
/* If we MUST delete this frame, delete the other first.
But do this only if FORCE equals `noelisp'. */

View file

@ -3213,6 +3213,8 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
described by W was deleted, as indicated by its buffer
field being reset to nil. */
f = x_window_to_frame (dpyinfo, hwnd);
if (!(f && FRAME_LIVE_P (f)))
break;
w = XWINDOW (FRAME_SELECTED_WINDOW (f));
/* Punt if someone changed the frame's selected window
behind our back. */