aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-05-12 17:16:01 -0500
committerTed Gould <ted@canonical.com>2009-05-12 17:16:01 -0500
commit2a8ccfdd673c5e883754768f2d77515e35b24454 (patch)
tree366a165425fd5ff1ec23a11af70a8a55265159b4 /libdbusmenu-glib
parentf7400044fe2ab33832b73ec26b5655435f91909b (diff)
downloadlibdbusmenu-2a8ccfdd673c5e883754768f2d77515e35b24454.tar.gz
libdbusmenu-2a8ccfdd673c5e883754768f2d77515e35b24454.tar.bz2
libdbusmenu-2a8ccfdd673c5e883754768f2d77515e35b24454.zip
Okay, now we have a lifecycle for all of our nifty signal handlers. Kinda crazy that we're building all of these suckers. Recursive setting all hidden in a nifty little function.
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r--libdbusmenu-glib/server.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c
index 34bc697..95fa1d9 100644
--- a/libdbusmenu-glib/server.c
+++ b/libdbusmenu-glib/server.c
@@ -182,6 +182,13 @@ dbusmenu_server_init (DbusmenuServer *self)
static void
dbusmenu_server_dispose (GObject *object)
{
+ DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(object);
+
+ if (priv->root != NULL) {
+ dbusmenu_menuitem_foreach(priv->root, menuitem_signals_remove, object);
+ g_object_unref(priv->root);
+ }
+
G_OBJECT_CLASS (dbusmenu_server_parent_class)->dispose (object);
return;
}
@@ -209,12 +216,14 @@ set_property (GObject * obj, guint id, const GValue * value, GParamSpec * pspec)
break;
case PROP_ROOT_NODE:
if (priv->root != NULL) {
+ dbusmenu_menuitem_foreach(priv->root, menuitem_signals_remove, obj);
g_object_unref(G_OBJECT(priv->root));
priv->root = NULL;
}
priv->root = DBUSMENU_MENUITEM(g_value_get_object(value));
if (priv->root != NULL) {
g_object_ref(G_OBJECT(priv->root));
+ dbusmenu_menuitem_foreach(priv->root, menuitem_signals_create, obj);
} else {
g_debug("Setting root node to NULL");
}