From: Po Lu Date: Tue, 3 Jan 2023 07:12:39 +0000 (+0800) Subject: Fix potential crash with fast mouse position enabled X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b5b6159d036fd167c6cab21532c2fdd587051d28;p=emacs.git Fix potential crash with fast mouse position enabled * src/xterm.c (x_free_frame_resources): Clear last_mouse_motion_frame and last_mouse_frame if required. --- diff --git a/src/xterm.c b/src/xterm.c index 8d8b0a0c0aa..028bb7582c4 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -28841,6 +28841,13 @@ x_free_frame_resources (struct frame *f) if (f == hlinfo->mouse_face_mouse_frame) reset_mouse_highlight (hlinfo); + /* These two need to be freed now that they are used to compute the + mouse position, I think. */ + if (f == dpyinfo->last_mouse_motion_frame) + dpyinfo->last_mouse_motion_frame = NULL; + if (f == dpyinfo->last_mouse_frame) + dpyinfo->last_mouse_frame = NULL; + #ifdef HAVE_XINPUT2 /* Consider a frame being unfocused with no following FocusIn event while an older focus from another seat exists. The client