[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 18a7267 3/3: Fix crash in ns_mouse_position (bug#44313)
From: |
Alan Third |
Subject: |
master 18a7267 3/3: Fix crash in ns_mouse_position (bug#44313) |
Date: |
Mon, 9 Nov 2020 09:54:09 -0500 (EST) |
branch: master
commit 18a7267c32a909bb26bd93d24543155aeb10e042
Author: Alan Third <alan@idiocy.org>
Commit: Alan Third <alan@idiocy.org>
Fix crash in ns_mouse_position (bug#44313)
* src/nsterm.m (ns_destroy_window): Close the window before freeing
the frame resources so we don't end up accessing the frame struct
after it's been freed.
---
src/nsterm.m | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/nsterm.m b/src/nsterm.m
index fa38350..4fad521 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1782,6 +1782,8 @@ ns_destroy_window (struct frame *f)
{
NSTRACE ("ns_destroy_window");
+ check_window_system (f);
+
/* If this frame has a parent window, detach it as not doing so can
cause a crash in GNUStep. */
if (FRAME_PARENT_FRAME (f) != NULL)
@@ -1792,7 +1794,7 @@ ns_destroy_window (struct frame *f)
[parent removeChildWindow: child];
}
- check_window_system (f);
+ [[FRAME_NS_VIEW (f) window] close];
ns_free_frame_resources (f);
ns_window_num--;
}