Merge lp:~dbusmenu-team/libdbusmenu/ubuntu into lp:~ubuntu-desktop/libdbusmenu/ubuntu

Proposed by Ted Gould
Status: Merged
Merged at revision: not available
Proposed branch: lp:~dbusmenu-team/libdbusmenu/ubuntu
Merge into: lp:~ubuntu-desktop/libdbusmenu/ubuntu
Diff against target: 162 lines (+26/-12)
3 files modified
debian/changelog (+11/-0)
libdbusmenu-glib/client.c (+13/-10)
libdbusmenu-glib/menuitem.c (+2/-2)
To merge this branch: bzr merge lp:~dbusmenu-team/libdbusmenu/ubuntu
Reviewer Review Type Date Requested Status
Sebastien Bacher Pending
Review via email: mp+23614@code.launchpad.net

Description of the change

I don't think these have been filled yet. :) (actually ahead of users) But, it's most noticible when you kill indicator-messages-services there's a duplication in the menu. And you can get a crash in some instances with the attribute update async stuff.

To post a comment you must log in.
lp:~dbusmenu-team/libdbusmenu/ubuntu updated
74. By Sebastien Bacher

releasing version 0.2.9-0ubuntu3

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2010-04-15 09:06:32 +0000
+++ debian/changelog 2010-04-17 18:16:21 +0000
@@ -1,3 +1,14 @@
1libdbusmenu (0.2.9-0ubuntu3~ppa1) lucid; urgency=low
2
3 * Upstream Merge
4 * Only unref root if the root has changed.
5 * Ensure that callbacks retain references to objects incase
6 they get deleted quickly.
7 * Protecting references before signalling
8 * Decrementing refs when added to child menus
9
10 -- Ted Gould <ted@ubuntu.com> Sat, 17 Apr 2010 13:09:57 -0500
11
1libdbusmenu (0.2.9-0ubuntu2) lucid; urgency=low12libdbusmenu (0.2.9-0ubuntu2) lucid; urgency=low
213
3 * Upstream Merge14 * Upstream Merge
415
=== modified file 'libdbusmenu-glib/client.c'
--- libdbusmenu-glib/client.c 2010-04-15 04:53:11 +0000
+++ libdbusmenu-glib/client.c 2010-04-17 18:16:21 +0000
@@ -367,6 +367,7 @@
367367
368 gchar * properties[1] = {NULL}; /* This gets them all */368 gchar * properties[1] = {NULL}; /* This gets them all */
369 g_debug("Getting properties");369 g_debug("Getting properties");
370 g_object_ref(menuitem);
370 org_ayatana_dbusmenu_get_properties_async(proxy, id, (const gchar **)properties, menuitem_get_properties_cb, menuitem);371 org_ayatana_dbusmenu_get_properties_async(proxy, id, (const gchar **)properties, menuitem_get_properties_cb, menuitem);
371 return;372 return;
372}373}
@@ -574,10 +575,12 @@
574 g_return_if_fail(DBUSMENU_IS_MENUITEM(data));575 g_return_if_fail(DBUSMENU_IS_MENUITEM(data));
575 if (error != NULL) {576 if (error != NULL) {
576 g_warning("Error getting properties on a menuitem: %s", error->message);577 g_warning("Error getting properties on a menuitem: %s", error->message);
578 g_object_unref(data);
577 return;579 return;
578 }580 }
579 g_hash_table_foreach(properties, get_properties_helper, data);581 g_hash_table_foreach(properties, get_properties_helper, data);
580 g_hash_table_destroy(properties);582 g_hash_table_destroy(properties);
583 g_object_unref(data);
581 return;584 return;
582}585}
583586
@@ -606,6 +609,8 @@
606609
607 if (!have_error) {610 if (!have_error) {
608 menuitem_get_properties_cb(proxy, properties, error, data);611 menuitem_get_properties_cb(proxy, properties, error, data);
612 } else {
613 g_object_unref(data);
609 }614 }
610615
611 return;616 return;
@@ -618,6 +623,7 @@
618{623{
619 if (error != NULL) {624 if (error != NULL) {
620 g_warning("Error getting properties on a new menuitem: %s", error->message);625 g_warning("Error getting properties on a new menuitem: %s", error->message);
626 g_object_unref(data);
621 return;627 return;
622 }628 }
623 g_return_if_fail(data != NULL);629 g_return_if_fail(data != NULL);
@@ -625,6 +631,7 @@
625 newItemPropData * propdata = (newItemPropData *)data;631 newItemPropData * propdata = (newItemPropData *)data;
626 DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(propdata->client);632 DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(propdata->client);
627633
634 g_object_ref(propdata->item);
628 menuitem_get_properties_cb (proxy, properties, error, propdata->item);635 menuitem_get_properties_cb (proxy, properties, error, propdata->item);
629636
630 gboolean handled = FALSE;637 gboolean handled = FALSE;
@@ -652,6 +659,7 @@
652 g_signal_emit(G_OBJECT(propdata->client), signals[NEW_MENUITEM], 0, propdata->item, TRUE);659 g_signal_emit(G_OBJECT(propdata->client), signals[NEW_MENUITEM], 0, propdata->item, TRUE);
653 }660 }
654661
662 g_object_unref(propdata->item);
655 g_free(propdata);663 g_free(propdata);
656664
657 return;665 return;
@@ -749,8 +757,6 @@
749 if (parent != NULL) {757 if (parent != NULL) {
750 dbusmenu_menuitem_child_delete(parent, item);758 dbusmenu_menuitem_child_delete(parent, item);
751 }759 }
752 /* XXX: Should this be an unref? Who's reffing this that it exists without a parent? */
753 g_object_unref(G_OBJECT(item));
754 item = NULL;760 item = NULL;
755 }761 }
756762
@@ -769,6 +775,7 @@
769 propdata->parent = parent;775 propdata->parent = parent;
770776
771 gchar * properties[1] = {NULL}; /* This gets them all */777 gchar * properties[1] = {NULL}; /* This gets them all */
778 g_object_ref(item);
772 org_ayatana_dbusmenu_get_properties_async(proxy, id, (const gchar **)properties, menuitem_get_properties_new_cb, propdata);779 org_ayatana_dbusmenu_get_properties_async(proxy, id, (const gchar **)properties, menuitem_get_properties_new_cb, propdata);
773 } else {780 } else {
774 g_warning("Unable to allocate memory to get properties for menuitem. This menuitem will never be realized.");781 g_warning("Unable to allocate memory to get properties for menuitem. This menuitem will never be realized.");
@@ -777,6 +784,7 @@
777 /* Refresh the properties */784 /* Refresh the properties */
778 /* XXX: We shouldn't need to get the properties everytime we reuse an entry */785 /* XXX: We shouldn't need to get the properties everytime we reuse an entry */
779 gchar * properties[1] = {NULL}; /* This gets them all */786 gchar * properties[1] = {NULL}; /* This gets them all */
787 g_object_ref(item);
780 org_ayatana_dbusmenu_get_properties_async(proxy, id, (const gchar **)properties, menuitem_get_properties_replace_cb, item);788 org_ayatana_dbusmenu_get_properties_async(proxy, id, (const gchar **)properties, menuitem_get_properties_replace_cb, item);
781 }789 }
782790
@@ -810,6 +818,7 @@
810 dbusmenu_menuitem_child_delete(item, childmi);818 dbusmenu_menuitem_child_delete(item, childmi);
811 }819 }
812 dbusmenu_menuitem_child_add_position(item, newchildmi, position);820 dbusmenu_menuitem_child_add_position(item, newchildmi, position);
821 g_object_unref(newchildmi);
813 } else {822 } else {
814 dbusmenu_menuitem_child_reorder(item, childmi, position);823 dbusmenu_menuitem_child_reorder(item, childmi, position);
815 }824 }
@@ -847,9 +856,6 @@
847 xmlNodePtr root = xmlDocGetRootElement(xmldoc);856 xmlNodePtr root = xmlDocGetRootElement(xmldoc);
848857
849 DbusmenuMenuitem * oldroot = priv->root;858 DbusmenuMenuitem * oldroot = priv->root;
850 if (oldroot != NULL) {
851 g_object_ref(oldroot);
852 }
853859
854 priv->root = parse_layout_xml(client, root, priv->root, NULL, priv->menuproxy);860 priv->root = parse_layout_xml(client, root, priv->root, NULL, priv->menuproxy);
855 xmlFreeDoc(xmldoc);861 xmlFreeDoc(xmldoc);
@@ -867,17 +873,14 @@
867 clean up that old root */873 clean up that old root */
868 if (oldroot != NULL) {874 if (oldroot != NULL) {
869 dbusmenu_menuitem_set_root(oldroot, FALSE);875 dbusmenu_menuitem_set_root(oldroot, FALSE);
876 g_object_unref(oldroot);
877 oldroot = NULL;
870 }878 }
871879
872 /* If the root changed we can signal that */880 /* If the root changed we can signal that */
873 g_signal_emit(G_OBJECT(client), signals[ROOT_CHANGED], 0, priv->root, TRUE);881 g_signal_emit(G_OBJECT(client), signals[ROOT_CHANGED], 0, priv->root, TRUE);
874 }882 }
875883
876 /* We need to unref it in this function no matter */
877 if (oldroot != NULL) {
878 g_object_unref(oldroot);
879 }
880
881 return 1;884 return 1;
882}885}
883886
884887
=== modified file 'libdbusmenu-glib/menuitem.c'
--- libdbusmenu-glib/menuitem.c 2010-04-15 04:47:01 +0000
+++ libdbusmenu-glib/menuitem.c 2010-04-17 18:16:21 +0000
@@ -491,8 +491,8 @@
491 #ifdef MASSIVEDEBUGGING491 #ifdef MASSIVEDEBUGGING
492 g_debug("Menuitem %d (%s) signalling child removed %d (%s)", ID(user_data), LABEL(user_data), ID(data), LABEL(data));492 g_debug("Menuitem %d (%s) signalling child removed %d (%s)", ID(user_data), LABEL(user_data), ID(data), LABEL(data));
493 #endif493 #endif
494 g_signal_emit(G_OBJECT(user_data), signals[CHILD_REMOVED], 0, DBUSMENU_MENUITEM(data), TRUE);
494 g_object_unref(G_OBJECT(data));495 g_object_unref(G_OBJECT(data));
495 g_signal_emit(G_OBJECT(user_data), signals[CHILD_REMOVED], 0, DBUSMENU_MENUITEM(data), TRUE);
496 return;496 return;
497}497}
498498
@@ -681,8 +681,8 @@
681 #ifdef MASSIVEDEBUGGING681 #ifdef MASSIVEDEBUGGING
682 g_debug("Menuitem %d (%s) signalling child removed %d (%s)", ID(mi), LABEL(mi), ID(child), LABEL(child));682 g_debug("Menuitem %d (%s) signalling child removed %d (%s)", ID(mi), LABEL(mi), ID(child), LABEL(child));
683 #endif683 #endif
684 g_signal_emit(G_OBJECT(mi), signals[CHILD_REMOVED], 0, child, TRUE);
684 g_object_unref(G_OBJECT(child));685 g_object_unref(G_OBJECT(child));
685 g_signal_emit(G_OBJECT(mi), signals[CHILD_REMOVED], 0, child, TRUE);
686 return TRUE;686 return TRUE;
687}687}
688688

Subscribers

People subscribed via source and target branches

to all changes: