diff options
author | Jan Ziak <0xe2.0x9a.0x9b@gmail.com> | 2020-12-29 00:10:04 +0100 |
---|---|---|
committer | Andre Miranda <andreldm@xfce.org> | 2021-01-25 16:15:10 -0300 |
commit | ebd2f74c1a48fc1dd4d1a47c36963e3a467f749d (patch) | |
tree | ecf1e0c8e97c453e8e2b5bfff81b38b5ab99e773 | |
parent | 29eddbed1431d8e57f2d4cca5ce391b44154ac88 (diff) | |
download | xfdesktop-ebd2f74c1a48fc1dd4d1a47c36963e3a467f749d.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 is somewhere between 10 KB and 80 KB.
Co-authored-by: Theo Linkspfeifer <lastonestanding@tutanota.com>
Closes: https://gitlab.xfce.org/xfce/xfdesktop/-/issues/102
-rw-r--r-- | src/menu.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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 */ |