Fix leaks with ThunarMenuX objects
Description
After applying thunar-plugins/thunar-vcs-plugin!15 (merged), I still saw leaks when opening context menus in Thunar with thunar-vcs-plugin installed.
I'm not sure if this is a proper fix, but I didn't notice any side effects while testing the Git context menu from thunar-vcs-plugin.
Leak report
Direct leak of 48 byte(s) in 1 object(s) allocated from:
#0 0x762409b2073d in calloc /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:74
#1 0x7624077b6735 in g_malloc0 glib/gmem.c:133
#2 0x762407f859d0 in g_type_create_instance gobject/gtype.c:1882
#3 0x762407f2dda5 in g_object_new_internal gobject/gobject.c:2687
#4 0x762407f32b2a in g_object_new_with_properties gobject/gobject.c:2849
#5 0x762407f34877 in g_object_new gobject/gobject.c:2498
#6 0x76240a22074e in IA__thunarx_menu_new thunarx/thunarx-menu.c:103
#7 0x7223f39fcd1e in tvp_git_action_create_menu_item thunar-vcs-plugin/tvp-git-action.c:220
#8 0x7223f39fcd1e in tvp_git_action_new thunar-vcs-plugin/tvp-git-action.c:162
#9 0x7223f39fad06 in tvp_provider_get_folder_menu_items thunar-vcs-plugin/tvp-provider.c:501
#10 0x76240a21fbca in IA__thunarx_menu_provider_get_folder_menu_items thunarx/thunarx-menu-provider.c:182
#11 0x5f87783a1bf2 in thunar_action_manager_append_custom_actions thunar/thunar-action-manager.c:2423
#12 0x5f8778471ad8 in thunar_menu_add_sections thunar/thunar-menu.c:335
#13 0x5f8778501caf in thunar_standard_view_context_menu thunar/thunar-standard-view.c:4229
#14 0x5f8778388805 in thunar_abstract_icon_view_button_press_event thunar/thunar-abstract-icon-view.c:452
[...snip...]
Direct leak of 48 byte(s) in 1 object(s) allocated from:
#0 0x762409b2073d in calloc /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:74
#1 0x7624077b6735 in g_malloc0 glib/gmem.c:133
#2 0x762407f859d0 in g_type_create_instance gobject/gtype.c:1882
#3 0x762407f2dda5 in g_object_new_internal gobject/gobject.c:2687
#4 0x762407f32b2a in g_object_new_with_properties gobject/gobject.c:2849
#5 0x762407f34877 in g_object_new gobject/gobject.c:2498
#6 0x76240a22074e in IA__thunarx_menu_new thunarx/thunarx-menu.c:103
#7 0x7223f39fcd1e in tvp_git_action_create_menu_item thunar-vcs-plugin/tvp-git-action.c:220
#8 0x7223f39fcd1e in tvp_git_action_new thunar-vcs-plugin/tvp-git-action.c:162
#9 0x7223f39fb2b2 in tvp_provider_get_file_menu_items thunar-vcs-plugin/tvp-provider.c:459
#10 0x76240a21f739 in IA__thunarx_menu_provider_get_file_menu_items thunarx/thunarx-menu-provider.c:126
#11 0x5f87783a1dd1 in thunar_action_manager_append_custom_actions thunar/thunar-action-manager.c:2425
#12 0x5f8778471ad8 in thunar_menu_add_sections thunar/thunar-menu.c:335
#13 0x5f8778501a1d in thunar_standard_view_context_menu thunar/thunar-standard-view.c:4215
#14 0x5f8778501f5e in thunar_standard_view_button_release_event thunar/thunar-standard-view.c:3025
[...snip...]
Testing
- No issues were detected when testing the patch with UBSan, LSan, ASan, and Valgrind