From 612f29ce1c86beba81934451dbc1009124dac5a8 Mon Sep 17 00:00:00 2001 From: "Matthew J. Francis" Date: Mon, 29 Sep 2014 00:39:33 +0800 Subject: Avoid leaking dbus objects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ifb6a7bb3867bba293fd256c87998528a90053507 Reviewed-on: https://gerrit.libreoffice.org/11678 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/unx/gtk/window/hudawareness.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vcl/unx/gtk/window/hudawareness.cxx b/vcl/unx/gtk/window/hudawareness.cxx index 1f2e56f93bcf..866c1b1f0701 100644 --- a/vcl/unx/gtk/window/hudawareness.cxx +++ b/vcl/unx/gtk/window/hudawareness.cxx @@ -56,6 +56,7 @@ hud_awareness_register (GDBusConnection *connection, GError **error) { static GDBusInterfaceInfo *iface; + static GDBusNodeInfo *info; GDBusInterfaceVTable vtable; HudAwarenessHandle *handle; guint object_id; @@ -66,7 +67,6 @@ hud_awareness_register (GDBusConnection *connection, if G_UNLIKELY (iface == NULL) { GError *local_error = NULL; - GDBusNodeInfo *info; info = g_dbus_node_info_new_for_xml ("" "" @@ -82,13 +82,13 @@ hud_awareness_register (GDBusConnection *connection, g_assert (iface != NULL); } - handle = g_slice_new (HudAwarenessHandle); + handle = (HudAwarenessHandle*) g_malloc (sizeof (HudAwarenessHandle)); - object_id = g_dbus_connection_register_object (connection, object_path, iface, &vtable, handle, NULL, error); + object_id = g_dbus_connection_register_object (connection, object_path, iface, &vtable, handle, &g_free, error); if (object_id == 0) { - g_slice_free (HudAwarenessHandle, handle); + g_free (handle); return 0; } -- cgit