diff options
| author | Alan Third | 2020-10-31 15:14:34 +0000 |
|---|---|---|
| committer | Alan Third | 2020-11-09 14:49:52 +0000 |
| commit | 18a7267c32a909bb26bd93d24543155aeb10e042 (patch) | |
| tree | 21354b30363c80f0126e8846f8289a6145ca20d0 /src | |
| parent | b4ec9cf79c67c16096d93b4ed682d8e19278bab3 (diff) | |
| download | emacs-18a7267c32a909bb26bd93d24543155aeb10e042.tar.gz emacs-18a7267c32a909bb26bd93d24543155aeb10e042.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/nsterm.m | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nsterm.m b/src/nsterm.m index fa38350a2f6..4fad521b74c 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -1782,6 +1782,8 @@ ns_destroy_window (struct frame *f) | |||
| 1782 | { | 1782 | { |
| 1783 | NSTRACE ("ns_destroy_window"); | 1783 | NSTRACE ("ns_destroy_window"); |
| 1784 | 1784 | ||
| 1785 | check_window_system (f); | ||
| 1786 | |||
| 1785 | /* If this frame has a parent window, detach it as not doing so can | 1787 | /* If this frame has a parent window, detach it as not doing so can |
| 1786 | cause a crash in GNUStep. */ | 1788 | cause a crash in GNUStep. */ |
| 1787 | if (FRAME_PARENT_FRAME (f) != NULL) | 1789 | if (FRAME_PARENT_FRAME (f) != NULL) |
| @@ -1792,7 +1794,7 @@ ns_destroy_window (struct frame *f) | |||
| 1792 | [parent removeChildWindow: child]; | 1794 | [parent removeChildWindow: child]; |
| 1793 | } | 1795 | } |
| 1794 | 1796 | ||
| 1795 | check_window_system (f); | 1797 | [[FRAME_NS_VIEW (f) window] close]; |
| 1796 | ns_free_frame_resources (f); | 1798 | ns_free_frame_resources (f); |
| 1797 | ns_window_num--; | 1799 | ns_window_num--; |
| 1798 | } | 1800 | } |