From 623b9c346ee991dfbff7fe89ff80834127a39014 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Apr 2010 10:43:31 -0500 Subject: Unreffing the object after it's been put into a menu. --- libdbusmenu-glib/client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index d61b1ae..910f9a1 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -810,6 +810,7 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it dbusmenu_menuitem_child_delete(item, childmi); } dbusmenu_menuitem_child_add_position(item, newchildmi, position); + g_object_unref(newchildmi); } else { dbusmenu_menuitem_child_reorder(item, childmi, position); } -- cgit v1.2.3 From 6085d46272fb067b475f433ecf5a5477dfa4e721 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Apr 2010 10:47:39 -0500 Subject: Since we already have a ref to root, we don't need to make another. --- libdbusmenu-glib/client.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 910f9a1..f5e7115 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -848,9 +848,6 @@ parse_layout (DbusmenuClient * client, const gchar * layout) xmlNodePtr root = xmlDocGetRootElement(xmldoc); DbusmenuMenuitem * oldroot = priv->root; - if (oldroot != NULL) { - g_object_ref(oldroot); - } priv->root = parse_layout_xml(client, root, priv->root, NULL, priv->menuproxy); xmlFreeDoc(xmldoc); -- cgit v1.2.3 From 7fc5afd02428815be2978548aaf3676e0fd45f37 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Apr 2010 10:54:25 -0500 Subject: releasing version 0.2.9-0ubuntu2~ppa2~refs1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index a6557bd..f1cd8a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -libdbusmenu (0.2.9-0ubuntu2~ppa2~refs1) UNRELEASED; urgency=low +libdbusmenu (0.2.9-0ubuntu2~ppa2~refs1) lucid; urgency=low * Upstream Merge * Decrementing refs when added to child menus - -- Ted Gould Fri, 16 Apr 2010 10:48:14 -0500 + -- Ted Gould Fri, 16 Apr 2010 10:54:22 -0500 libdbusmenu (0.2.9-0ubuntu2~ppa1) lucid; urgency=low -- cgit v1.2.3 From e606dae698cb9a4e15fdc260c68744cbee7c3c82 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Apr 2010 11:04:16 -0500 Subject: Reffing oldroot again. --- libdbusmenu-glib/client.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index f5e7115..910f9a1 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -848,6 +848,9 @@ parse_layout (DbusmenuClient * client, const gchar * layout) xmlNodePtr root = xmlDocGetRootElement(xmldoc); DbusmenuMenuitem * oldroot = priv->root; + if (oldroot != NULL) { + g_object_ref(oldroot); + } priv->root = parse_layout_xml(client, root, priv->root, NULL, priv->menuproxy); xmlFreeDoc(xmldoc); -- cgit v1.2.3 From f8cf97fa209b64c4f466cda3c33bbec068a4539c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Apr 2010 11:43:06 -0500 Subject: Make sure to send the signal *before* unrefing so the object exists --- libdbusmenu-glib/menuitem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index 220f7e5..6a3c4bc 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -491,8 +491,8 @@ take_children_signal (gpointer data, gpointer user_data) #ifdef MASSIVEDEBUGGING g_debug("Menuitem %d (%s) signalling child removed %d (%s)", ID(user_data), LABEL(user_data), ID(data), LABEL(data)); #endif - g_object_unref(G_OBJECT(data)); g_signal_emit(G_OBJECT(user_data), signals[CHILD_REMOVED], 0, DBUSMENU_MENUITEM(data), TRUE); + g_object_unref(G_OBJECT(data)); return; } @@ -681,8 +681,8 @@ dbusmenu_menuitem_child_delete (DbusmenuMenuitem * mi, DbusmenuMenuitem * child) #ifdef MASSIVEDEBUGGING g_debug("Menuitem %d (%s) signalling child removed %d (%s)", ID(mi), LABEL(mi), ID(child), LABEL(child)); #endif - g_object_unref(G_OBJECT(child)); g_signal_emit(G_OBJECT(mi), signals[CHILD_REMOVED], 0, child, TRUE); + g_object_unref(G_OBJECT(child)); return TRUE; } -- cgit v1.2.3 From 33fa3fd7eeed10107b96698d23a9e0fc8f03c2f8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Apr 2010 11:45:57 -0500 Subject: releasing version 0.2.9-0ubuntu2~ppa2~refs3 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index b01b3e6..1324d15 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -libdbusmenu (0.2.9-0ubuntu2~ppa2~refs3) UNRELEASED; urgency=low +libdbusmenu (0.2.9-0ubuntu2~ppa2~refs3) lucid; urgency=low * Upstream merge * Protecting references before signalling - -- Ted Gould Fri, 16 Apr 2010 11:43:18 -0500 + -- Ted Gould Fri, 16 Apr 2010 11:45:54 -0500 libdbusmenu (0.2.9-0ubuntu2~ppa2~refs2) lucid; urgency=low -- cgit v1.2.3 From 541193c9c95a4ee22286a9f43abf05741361f702 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Apr 2010 11:50:20 -0500 Subject: Removing the unref that was causing issues so that we can remove an extra ref of the root item. --- libdbusmenu-glib/client.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 910f9a1..c8706ac 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -749,8 +749,6 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it if (parent != NULL) { dbusmenu_menuitem_child_delete(parent, item); } - /* XXX: Should this be an unref? Who's reffing this that it exists without a parent? */ - g_object_unref(G_OBJECT(item)); item = NULL; } @@ -848,9 +846,6 @@ parse_layout (DbusmenuClient * client, const gchar * layout) xmlNodePtr root = xmlDocGetRootElement(xmldoc); DbusmenuMenuitem * oldroot = priv->root; - if (oldroot != NULL) { - g_object_ref(oldroot); - } priv->root = parse_layout_xml(client, root, priv->root, NULL, priv->menuproxy); xmlFreeDoc(xmldoc); -- cgit v1.2.3 From a9eef64661d79c56329bdc895a6e390f6fcea7d0 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Apr 2010 11:54:24 -0500 Subject: releasing version 0.2.9-0ubuntu2~ppa2~refs4 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index eeb6d06..9ca9b4d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -libdbusmenu (0.2.9-0ubuntu2~ppa2~refs4) UNRELEASED; urgency=low +libdbusmenu (0.2.9-0ubuntu2~ppa2~refs4) lucid; urgency=low * Upstream merge * Removing extra unref which allows us to not make an extra ref. - -- Ted Gould Fri, 16 Apr 2010 11:50:51 -0500 + -- Ted Gould Fri, 16 Apr 2010 11:54:19 -0500 libdbusmenu (0.2.9-0ubuntu2~ppa2~refs3) lucid; urgency=low -- cgit v1.2.3 From 5cdb4b7f20df54f8ee25a216c2381178636ff0c9 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Apr 2010 11:59:46 -0500 Subject: debian/rules: Massive debugging --- debian/changelog | 6 ++++++ debian/rules | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 9ca9b4d..fda5a87 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libdbusmenu (0.2.9-0ubuntu2~ppa2~refs5) UNRELEASED; urgency=low + + * debian/rules: Massive debugging + + -- Ted Gould Fri, 16 Apr 2010 11:59:28 -0500 + libdbusmenu (0.2.9-0ubuntu2~ppa2~refs4) lucid; urgency=low * Upstream merge diff --git a/debian/rules b/debian/rules index c23bde6..7399803 100755 --- a/debian/rules +++ b/debian/rules @@ -3,7 +3,7 @@ include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/gnome.mk -DEB_CONFIGURE_EXTRA_FLAGS += --disable-scrollkeeper +DEB_CONFIGURE_EXTRA_FLAGS += --disable-scrollkeeper --enable-massivedebugging LDFLAGS += -Wl,-z,defs -Wl,--as-needed DEB_DH_MAKESHLIBS_ARGS_libdbusmenu-gtk1 += -V 'libdbusmenu-gtk1 (>= 0.2.5)' -- cgit v1.2.3 From 4ffcefaf2369d9069be8116820984c7289d81302 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Apr 2010 12:02:51 -0500 Subject: releasing version 0.2.9-0ubuntu2~ppa2~refs5 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index fda5a87..db776d7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -libdbusmenu (0.2.9-0ubuntu2~ppa2~refs5) UNRELEASED; urgency=low +libdbusmenu (0.2.9-0ubuntu2~ppa2~refs5) lucid; urgency=low * debian/rules: Massive debugging - -- Ted Gould Fri, 16 Apr 2010 11:59:28 -0500 + -- Ted Gould Fri, 16 Apr 2010 12:02:48 -0500 libdbusmenu (0.2.9-0ubuntu2~ppa2~refs4) lucid; urgency=low -- cgit v1.2.3 From e45ecac9a2dad70c782c33e8d2f9b3ce295238a3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Apr 2010 12:13:20 -0500 Subject: Adding references when calling the properties callbacks as items could get destroyed in transit. --- libdbusmenu-glib/client.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index c8706ac..3df5c6a 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -367,6 +367,7 @@ id_update (DBusGProxy * proxy, gint id, DbusmenuClient * client) gchar * properties[1] = {NULL}; /* This gets them all */ g_debug("Getting properties"); + g_object_ref(menuitem); org_ayatana_dbusmenu_get_properties_async(proxy, id, (const gchar **)properties, menuitem_get_properties_cb, menuitem); return; } @@ -574,10 +575,12 @@ menuitem_get_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError g_return_if_fail(DBUSMENU_IS_MENUITEM(data)); if (error != NULL) { g_warning("Error getting properties on a menuitem: %s", error->message); + g_object_unref(data); return; } g_hash_table_foreach(properties, get_properties_helper, data); g_hash_table_destroy(properties); + g_object_unref(data); return; } @@ -606,6 +609,8 @@ menuitem_get_properties_replace_cb (DBusGProxy * proxy, GHashTable * properties, if (!have_error) { menuitem_get_properties_cb(proxy, properties, error, data); + } else { + g_object_unref(data); } return; @@ -618,6 +623,7 @@ menuitem_get_properties_new_cb (DBusGProxy * proxy, GHashTable * properties, GEr { if (error != NULL) { g_warning("Error getting properties on a new menuitem: %s", error->message); + g_object_unref(data); return; } g_return_if_fail(data != NULL); @@ -625,6 +631,7 @@ menuitem_get_properties_new_cb (DBusGProxy * proxy, GHashTable * properties, GEr newItemPropData * propdata = (newItemPropData *)data; DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(propdata->client); + g_object_ref(propdata->item); menuitem_get_properties_cb (proxy, properties, error, propdata->item); gboolean handled = FALSE; @@ -652,6 +659,7 @@ menuitem_get_properties_new_cb (DBusGProxy * proxy, GHashTable * properties, GEr g_signal_emit(G_OBJECT(propdata->client), signals[NEW_MENUITEM], 0, propdata->item, TRUE); } + g_object_unref(propdata->item); g_free(propdata); return; @@ -767,6 +775,7 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it propdata->parent = parent; gchar * properties[1] = {NULL}; /* This gets them all */ + g_object_ref(item); org_ayatana_dbusmenu_get_properties_async(proxy, id, (const gchar **)properties, menuitem_get_properties_new_cb, propdata); } else { g_warning("Unable to allocate memory to get properties for menuitem. This menuitem will never be realized."); @@ -775,6 +784,7 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it /* Refresh the properties */ /* XXX: We shouldn't need to get the properties everytime we reuse an entry */ gchar * properties[1] = {NULL}; /* This gets them all */ + g_object_ref(item); org_ayatana_dbusmenu_get_properties_async(proxy, id, (const gchar **)properties, menuitem_get_properties_replace_cb, item); } -- cgit v1.2.3 From b8e566754bb9aad78726eb46305589a286a86ec3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Apr 2010 12:16:23 -0500 Subject: releasing version 0.2.9-0ubuntu2~ppa2~refs6 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index ef0362f..9983db4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -libdbusmenu (0.2.9-0ubuntu2~ppa2~refs6) UNRELEASED; urgency=low +libdbusmenu (0.2.9-0ubuntu2~ppa2~refs6) lucid; urgency=low * Upstream Merge * Ensure that callbacks retain references to objects incase they get deleted quickly. - -- Ted Gould Fri, 16 Apr 2010 12:13:33 -0500 + -- Ted Gould Fri, 16 Apr 2010 12:16:21 -0500 libdbusmenu (0.2.9-0ubuntu2~ppa2~refs5) lucid; urgency=low -- cgit v1.2.3 From e26f80a52f0453ee7efaca86487f5e04a17fd35b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Apr 2010 12:21:02 -0500 Subject: Now that we're not reffing the root locally, we need to only unref it if we're changing roots --- libdbusmenu-glib/client.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 3df5c6a..d2ba541 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -873,17 +873,14 @@ 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); + oldroot = NULL; } /* 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; } -- cgit v1.2.3 From 3440a98fcc055f181a27419922d0f243cea51df3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 16 Apr 2010 12:23:58 -0500 Subject: releasing version 0.2.9-0ubuntu2~ppa2~refs7 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2baf8be..849085b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -libdbusmenu (0.2.9-0ubuntu2~ppa2~refs7) UNRELEASED; urgency=low +libdbusmenu (0.2.9-0ubuntu2~ppa2~refs7) lucid; urgency=low * Upstream Merge * Only unref root if the root has changed. - -- Ted Gould Fri, 16 Apr 2010 12:21:30 -0500 + -- Ted Gould Fri, 16 Apr 2010 12:23:56 -0500 libdbusmenu (0.2.9-0ubuntu2~ppa2~refs6) lucid; urgency=low -- cgit v1.2.3 From ca5a088631f8ea85067b06f433d6f33bf569493a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sat, 17 Apr 2010 13:10:00 -0500 Subject: releasing version 0.2.9-0ubuntu3~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1ee114f..b7398a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -libdbusmenu (0.2.9-0ubuntu3~ppa1) UNRELEASED; urgency=low +libdbusmenu (0.2.9-0ubuntu3~ppa1) lucid; urgency=low * Upstream Merge * Only unref root if the root has changed. @@ -7,7 +7,7 @@ libdbusmenu (0.2.9-0ubuntu3~ppa1) UNRELEASED; urgency=low * Protecting references before signalling * Decrementing refs when added to child menus - -- Ted Gould Sat, 17 Apr 2010 12:53:25 -0500 + -- Ted Gould Sat, 17 Apr 2010 13:09:57 -0500 libdbusmenu (0.2.9-0ubuntu2) lucid; urgency=low -- cgit v1.2.3