emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master df5fb5fafa: Fix leak of saved menu event and output data


From: Po Lu
Subject: master df5fb5fafa: Fix leak of saved menu event and output data
Date: Mon, 21 Mar 2022 20:40:44 -0400 (EDT)

branch: master
commit df5fb5fafab73c96e06f139a883274c5f0660401
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix leak of saved menu event and output data
    
    * src/xterm.c (x_destroy_window, x_free_frame_resources): Free
    output data and saved menu event even if display is closed.
---
 src/xterm.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 3f16a116eb..be1dc9e3c9 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -17565,9 +17565,11 @@ x_free_frame_resources (struct frame *f)
 
   if (x_dnd_in_progress && f == x_dnd_frame)
     {
+      block_input ();
       if (x_dnd_last_seen_window != None
          && x_dnd_last_protocol_version != -1)
        x_dnd_send_leave (f, x_dnd_last_seen_window);
+      unblock_input ();
 
       x_dnd_in_progress = false;
       x_dnd_waiting_for_finish = false;
@@ -17737,10 +17739,6 @@ x_free_frame_resources (struct frame *f)
     g_object_unref (FRAME_OUTPUT_DATA (f)->scrollbar_foreground_css_provider);
 #endif
 
-  xfree (f->output_data.x->saved_menu_event);
-  xfree (f->output_data.x);
-  f->output_data.x = NULL;
-
   if (f == dpyinfo->x_focus_frame)
     dpyinfo->x_focus_frame = 0;
   if (f == dpyinfo->x_focus_event_frame)
@@ -17766,6 +17764,10 @@ x_destroy_window (struct frame *f)
   if (dpyinfo->display != 0)
     x_free_frame_resources (f);
 
+  xfree (f->output_data.x->saved_menu_event);
+  xfree (f->output_data.x);
+  f->output_data.x = NULL;
+
   dpyinfo->reference_count--;
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]