From: Yuuki Harano Date: Thu, 11 Mar 2021 12:13:23 +0000 (+0900) Subject: Fix some leaks X-Git-Tag: emacs-29.0.90~3718 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=56297c0f426314dde66614a5c4e459c285af939a;p=emacs.git Fix some leaks * src/pgtkterm.c (x_free_frame_resources): Free cursors. (pgtk_delete_terminal): Free cursors and events. --- diff --git a/src/pgtkterm.c b/src/pgtkterm.c index b965879a1c6..10a3999f70d 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -231,6 +231,23 @@ x_free_frame_resources (struct frame *f) if (f == hlinfo->mouse_face_mouse_frame) reset_mouse_highlight (hlinfo); + g_clear_object (&FRAME_X_OUTPUT (f)->text_cursor); + g_clear_object (&FRAME_X_OUTPUT (f)->nontext_cursor); + g_clear_object (&FRAME_X_OUTPUT (f)->modeline_cursor); + g_clear_object (&FRAME_X_OUTPUT (f)->hand_cursor); + g_clear_object (&FRAME_X_OUTPUT (f)->hourglass_cursor); + g_clear_object (&FRAME_X_OUTPUT (f)->horizontal_drag_cursor); + g_clear_object (&FRAME_X_OUTPUT (f)->vertical_drag_cursor); + g_clear_object (&FRAME_X_OUTPUT (f)->left_edge_cursor); + g_clear_object (&FRAME_X_OUTPUT (f)->right_edge_cursor); + g_clear_object (&FRAME_X_OUTPUT (f)->top_edge_cursor); + g_clear_object (&FRAME_X_OUTPUT (f)->bottom_edge_cursor); + g_clear_object (&FRAME_X_OUTPUT (f)->top_left_corner_cursor); + g_clear_object (&FRAME_X_OUTPUT (f)->top_right_corner_cursor); + g_clear_object (&FRAME_X_OUTPUT (f)->bottom_right_corner_cursor); + g_clear_object (&FRAME_X_OUTPUT (f)->bottom_left_corner_cursor); + + if (FRAME_X_OUTPUT (f)->border_color_css_provider != NULL) { GtkStyleContext *ctxt = gtk_widget_get_style_context (FRAME_WIDGET (f)); @@ -4687,6 +4704,15 @@ pgtk_delete_terminal (struct terminal *terminal) { image_destroy_all_bitmaps (dpyinfo); + g_clear_object (&dpyinfo->xg_cursor); + g_clear_object (&dpyinfo->vertical_scroll_bar_cursor); + g_clear_object (&dpyinfo->horizontal_scroll_bar_cursor); + g_clear_object (&dpyinfo->invisible_cursor); + if (dpyinfo->last_click_event != NULL) { + gdk_event_free (dpyinfo->last_click_event); + dpyinfo->last_click_event = NULL; + } + xg_display_close (dpyinfo->gdpy); /* Do not close the connection here because it's already closed