From 81474d977a9728b578f0eda577e64919d33ccedd Mon Sep 17 00:00:00 2001 From: gaobo-kylinsec Date: Thu, 23 Apr 2026 11:23:21 +0800 Subject: emblem-sidebar: fix memory leak of popup menu widget Destroy popup menu in finalize function since it's a floating widget without parent. Also nullify borrowed pointers to avoid dangling references. --- src/caja-emblem-sidebar.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/caja-emblem-sidebar.c b/src/caja-emblem-sidebar.c index f6fc6860..9c46837e 100644 --- a/src/caja-emblem-sidebar.c +++ b/src/caja-emblem-sidebar.c @@ -360,6 +360,10 @@ create_popup_menu (CajaEmblemSidebar *emblem_sidebar) popup = gtk_menu_new (); + gtk_menu_attach_to_widget (GTK_MENU (popup), + GTK_WIDGET (emblem_sidebar), + NULL); + gtk_menu_set_reserve_toggle_size (GTK_MENU (popup), FALSE); /* add the "rename" menu item */ -- cgit v1.2.1