summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgaobo-kylinsec <[email protected]>2026-04-23 11:23:21 +0800
committerVictor Kareh <[email protected]>2026-05-05 05:55:08 -0400
commit81474d977a9728b578f0eda577e64919d33ccedd (patch)
tree085c724aadbc0631aa5501602a8b75e65c1a7983 /src
parent3632e569ffc17ccd4cb167360510624c7a5d51ef (diff)
downloadcaja-81474d977a9728b578f0eda577e64919d33ccedd.tar.bz2
caja-81474d977a9728b578f0eda577e64919d33ccedd.tar.xz
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.
Diffstat (limited to 'src')
-rw-r--r--src/caja-emblem-sidebar.c4
1 files changed, 4 insertions, 0 deletions
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 */