[Libreoffice-commits] core.git: vcl/unx
Mark Wielaard
mark at klomp.org
Sun Aug 4 06:56:41 PDT 2013
vcl/unx/gtk/window/gtksalframe.cxx | 9 +++++++++
1 file changed, 9 insertions(+)
New commits:
commit 2abadc9a2f681b737f5fb1a2de7983fb65ffde45
Author: Mark Wielaard <mark at klomp.org>
Date: Sat Aug 3 21:23:44 2013 +0200
Fix memory leaks in ensure_dbus_setup.
g_menu_append_item and g_menu_append_section don't reference their
argument but copy the argument. So explicitly g_object_unref the
arguments afterwards.
Change-Id: I14f18d7571351a2eec99dc557b59e69b766fbde8
Reviewed-on: https://gerrit.libreoffice.org/5269
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index ea1ad0c..6780d9c 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -660,8 +660,10 @@ gboolean ensure_dbus_setup( gpointer data )
item = g_menu_item_new(sNew.getStr(), "app.New");
g_menu_append_item( firstsubmenu, item );
+ g_object_unref(item);
g_menu_append_section( menu, NULL, G_MENU_MODEL(firstsubmenu));
+ g_object_unref(firstsubmenu);
GMenu *secondsubmenu = g_menu_new ();
@@ -670,8 +672,11 @@ gboolean ensure_dbus_setup( gpointer data )
item = g_menu_item_new(sPreferences.getStr(), "app.OptionsTreeDialog");
g_menu_append_item( secondsubmenu, item );
+ g_object_unref(item);
g_menu_append_section( menu, NULL, G_MENU_MODEL(secondsubmenu));
+ g_object_unref(secondsubmenu);
+
GMenu *thirdsubmenu = g_menu_new ();
OString sHelp(OUStringToOString(ResId(SV_BUTTONTEXT_HELP, *pMgr).toString(),
@@ -679,19 +684,23 @@ gboolean ensure_dbus_setup( gpointer data )
item = g_menu_item_new(sHelp.getStr(), "app.HelpIndex");
g_menu_append_item( thirdsubmenu, item );
+ g_object_unref(item);
OString sAbout(OUStringToOString(ResId(SV_STDTEXT_ABOUT, *pMgr).toString(),
RTL_TEXTENCODING_UTF8).replaceFirst("~", "_"));
item = g_menu_item_new(sAbout.getStr(), "app.About");
g_menu_append_item( thirdsubmenu, item );
+ g_object_unref(item);
OString sQuit(OUStringToOString(ResId(SV_MENU_MAC_QUITAPP, *pMgr).toString(),
RTL_TEXTENCODING_UTF8).replaceFirst("~", "_"));
item = g_menu_item_new(sQuit.getStr(), "app.Quit");
g_menu_append_item( thirdsubmenu, item );
+ g_object_unref(item);
g_menu_append_section( menu, NULL, G_MENU_MODEL(thirdsubmenu));
+ g_object_unref(thirdsubmenu);
GSimpleActionGroup *group = g_simple_action_group_new ();
g_simple_action_group_add_entries (group, app_entries, G_N_ELEMENTS (app_entries), NULL);
More information about the Libreoffice-commits
mailing list