summaryrefslogtreecommitdiff
path: root/src/nsterm.m
diff options
context:
space:
mode:
authorAaron Jensen <aaronjensen@gmail.com>2018-03-21 22:30:08 -0700
committerAlan Third <alan@idiocy.org>2018-03-25 20:13:05 +0100
commit95ccf50e37dc5a55ea19283ef208e4fd3aad5ff8 (patch)
tree3a2edebe36072a6a4d4029ed44307ff184a487f1 /src/nsterm.m
parent45d04754e718846b1a2a84a1eac6b5a54f3ade16 (diff)
downloademacs-95ccf50e37dc5a55ea19283ef208e4fd3aad5ff8.tar.gz
Fix crash after frame is freed on macOS (bug#30800)
* src/nsterm.m (x_free_frame_resources): Clear represented_frame. (bug#30800)
Diffstat (limited to 'src/nsterm.m')
-rw-r--r--src/nsterm.m4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index 3d58cd5ec64..c8ae31abc09 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1692,6 +1692,10 @@ x_free_frame_resources (struct frame *f)
dpyinfo->x_highlight_frame = 0;
if (f == hlinfo->mouse_face_mouse_frame)
reset_mouse_highlight (hlinfo);
+ /* Ensure that sendEvent does not attempt to dereference a freed
+ frame. (bug#30800) */
+ if (represented_frame == f)
+ represented_frame = NULL;
if (f->output_data.ns->miniimage != nil)
[f->output_data.ns->miniimage release];