]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix potential crash with fast mouse position enabled
authorPo Lu <luangruo@yahoo.com>
Tue, 3 Jan 2023 07:12:39 +0000 (15:12 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 3 Jan 2023 07:13:08 +0000 (15:13 +0800)
* src/xterm.c (x_free_frame_resources): Clear
last_mouse_motion_frame and last_mouse_frame if required.

src/xterm.c

index 8d8b0a0c0aa73151bfe4c5f6d7cfda877d5d6c69..028bb7582c4ceb6bc5017ef26dff9e37cc01ad03 100644 (file)
@@ -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