aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-03-22 08:39:55 +0800
committerPo Lu2022-03-22 08:39:55 +0800
commitdf5fb5fafab73c96e06f139a883274c5f0660401 (patch)
tree307d8ec4dbdba4166a47b160c367bda9602fad9b /src
parent63a33c3057321a4d2fddbbfe34e11e87ef99b6ad (diff)
downloademacs-df5fb5fafab73c96e06f139a883274c5f0660401.tar.gz
emacs-df5fb5fafab73c96e06f139a883274c5f0660401.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 3f16a116ebf..be1dc9e3c98 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -17565,9 +17565,11 @@ x_free_frame_resources (struct frame *f)
17565 17565
17566 if (x_dnd_in_progress && f == x_dnd_frame) 17566 if (x_dnd_in_progress && f == x_dnd_frame)
17567 { 17567 {
17568 block_input ();
17568 if (x_dnd_last_seen_window != None 17569 if (x_dnd_last_seen_window != None
17569 && x_dnd_last_protocol_version != -1) 17570 && x_dnd_last_protocol_version != -1)
17570 x_dnd_send_leave (f, x_dnd_last_seen_window); 17571 x_dnd_send_leave (f, x_dnd_last_seen_window);
17572 unblock_input ();
17571 17573
17572 x_dnd_in_progress = false; 17574 x_dnd_in_progress = false;
17573 x_dnd_waiting_for_finish = false; 17575 x_dnd_waiting_for_finish = false;
@@ -17737,10 +17739,6 @@ x_free_frame_resources (struct frame *f)
17737 g_object_unref (FRAME_OUTPUT_DATA (f)->scrollbar_foreground_css_provider); 17739 g_object_unref (FRAME_OUTPUT_DATA (f)->scrollbar_foreground_css_provider);
17738#endif 17740#endif
17739 17741
17740 xfree (f->output_data.x->saved_menu_event);
17741 xfree (f->output_data.x);
17742 f->output_data.x = NULL;
17743
17744 if (f == dpyinfo->x_focus_frame) 17742 if (f == dpyinfo->x_focus_frame)
17745 dpyinfo->x_focus_frame = 0; 17743 dpyinfo->x_focus_frame = 0;
17746 if (f == dpyinfo->x_focus_event_frame) 17744 if (f == dpyinfo->x_focus_event_frame)
@@ -17766,6 +17764,10 @@ x_destroy_window (struct frame *f)
17766 if (dpyinfo->display != 0) 17764 if (dpyinfo->display != 0)
17767 x_free_frame_resources (f); 17765 x_free_frame_resources (f);
17768 17766
17767 xfree (f->output_data.x->saved_menu_event);
17768 xfree (f->output_data.x);
17769 f->output_data.x = NULL;
17770
17769 dpyinfo->reference_count--; 17771 dpyinfo->reference_count--;
17770} 17772}
17771 17773