diff options
author | Matthew J. Francis <mjay.francis@gmail.com> | 2014-09-29 00:39:33 +0800 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-09-28 17:40:44 +0000 |
commit | 612f29ce1c86beba81934451dbc1009124dac5a8 (patch) | |
tree | dd7ffa52c50513f4877e7ec7685d22e891a5a604 /vcl | |
parent | be18133e84120625734a09380594ee89b23c4322 (diff) |
Avoid leaking dbus objects
Change-Id: Ifb6a7bb3867bba293fd256c87998528a90053507
Reviewed-on: https://gerrit.libreoffice.org/11678
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk/window/hudawareness.cxx | 8 |
1 files 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 ("<node>" "<interface name='com.canonical.hud.Awareness'>" @@ -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; } |