diff options
author | Ted Gould <ted@gould.cx> | 2010-07-20 11:39:56 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-07-20 11:39:56 -0500 |
commit | 508c02c4188070e326839a3bbbf3e161592d7e4f (patch) | |
tree | 0b05eacbf97a8365f4e9b96beebfb326276903f0 /libdbusmenu-glib | |
parent | 9abd75fc8f41e0d1642bfd8dbf3cb6aaae36dfda (diff) | |
download | libdbusmenu-508c02c4188070e326839a3bbbf3e161592d7e4f.tar.gz libdbusmenu-508c02c4188070e326839a3bbbf3e161592d7e4f.tar.bz2 libdbusmenu-508c02c4188070e326839a3bbbf3e161592d7e4f.zip |
Fixing error handling in get_properties_new_cb
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/client.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index b142e15..b59aecd 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -906,16 +906,19 @@ menuitem_get_properties_replace_cb (DBusGProxy * proxy, GHashTable * properties, static void menuitem_get_properties_new_cb (DBusGProxy * proxy, GHashTable * properties, GError * error, gpointer data) { + g_return_if_fail(data != NULL); + newItemPropData * propdata = (newItemPropData *)data; + if (error != NULL) { g_warning("Error getting properties on a new menuitem: %s", error->message); - g_object_unref(data); + g_object_unref(propdata->item); + g_free(data); return; } - g_return_if_fail(data != NULL); - newItemPropData * propdata = (newItemPropData *)data; DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(propdata->client); + /* Extra ref as get_properties will unref once itself */ g_object_ref(propdata->item); menuitem_get_properties_cb (proxy, properties, error, propdata->item); |