aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-31 11:05:24 -0500
committerTed Gould <ted@gould.cx>2010-03-31 11:05:24 -0500
commit04ad3cb433ac8ed581998ea6ce69bd0e7d1dbb68 (patch)
tree24b7affff076e84ad531f1f796562e530cfe9fa8
parent63a5d2daa865aa68b4ea152a92373e3c187e13af (diff)
parent69f2190a6e57920e6086013c87cea5cc1734abcb (diff)
downloadlibdbusmenu-04ad3cb433ac8ed581998ea6ce69bd0e7d1dbb68.tar.gz
libdbusmenu-04ad3cb433ac8ed581998ea6ce69bd0e7d1dbb68.tar.bz2
libdbusmenu-04ad3cb433ac8ed581998ea6ce69bd0e7d1dbb68.zip
Update to clean up dbusmenu on syncing so we have references properly.
-rw-r--r--libdbusmenu-glib/client.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index 309a11c..fb2a2bc 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -337,7 +337,12 @@ id_prop_update (DBusGProxy * proxy, gint id, gchar * property, GValue * value, D
g_return_if_fail(priv->root != NULL);
DbusmenuMenuitem * menuitem = dbusmenu_menuitem_find_id(priv->root, id);
- g_return_if_fail(menuitem != NULL);
+ if (menuitem == NULL) {
+ #ifdef MASSIVEDEBUGGING
+ g_debug("Property update '%s' on id %d which couldn't be found", property, id);
+ #endif
+ return;
+ }
dbusmenu_menuitem_property_set_value(menuitem, property, value);
@@ -444,6 +449,9 @@ proxy_destroyed (GObject * gobj_proxy, gpointer userdata)
priv->layoutcall = NULL;
}
+ priv->current_revision = 0;
+ priv->my_revision = 0;
+
build_dbus_proxy(DBUSMENU_CLIENT(userdata));
return;
}
@@ -794,13 +802,17 @@ parse_layout (DbusmenuClient * client, const gchar * layout)
clean up that old root */
if (oldroot != NULL) {
dbusmenu_menuitem_set_root(oldroot, FALSE);
- g_object_unref(oldroot);
}
/* If the root changed we can signal that */
g_signal_emit(G_OBJECT(client), signals[ROOT_CHANGED], 0, priv->root, TRUE);
}
+ /* We need to unref it in this function no matter */
+ if (oldroot != NULL) {
+ g_object_unref(oldroot);
+ }
+
return 1;
}