summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Ziak <0xe2.0x9a.0x9b@gmail.com>2021-01-26 04:30:00 +0100
committerJan Ziak <0xe2.0x9a.0x9b@gmail.com>2021-02-15 17:17:47 +0100
commit2590cca23c558b475666ab1846711ab859a3fcd4 (patch)
tree04bdf751e05e1a32d56026b3394a123c44ae0c67
parentdb2a37a44fdacd4e8939c1305914801594880498 (diff)
downloadxfdesktop-2590cca23c558b475666ab1846711ab859a3fcd4.tar.gz
Fix Applications Menu memory leak (Bug #102)
This patch reduces the amount of memory leaked every time xfdesktop's Applications Menu is displayed via 'xfdesktop --menu'. Prior to this patch the increase in memory consumption is about 2-4 MB, and after this patch the memory increase should be somewhere between 10 KB and 80 KB. Co-authored-by: Theo Linkspfeifer <lastonestanding@tutanota.com> See also: https://gitlab.xfce.org/xfce/xfdesktop/-/issues/102
-rw-r--r--src/menu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/menu.c b/src/menu.c
index cafb2f5a..9fe96834 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -101,7 +101,9 @@ menu_populate(XfceDesktop *desktop,
* a toplevel menu */
else
{
+ g_object_ref_sink(G_OBJECT(desktop_menu));
xfce_gtk_menu_popup_until_mapped(GTK_MENU(desktop_menu), NULL, NULL, NULL, NULL, 3, gtk_get_current_event_time());
+ g_object_unref(G_OBJECT(desktop_menu));
}
}
#endif /* USE_DESKTOP_MENU */