diff options
author | Ted Gould <ted@gould.cx> | 2012-04-04 23:07:16 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2012-04-04 23:07:16 -0500 |
commit | 9e5453bb93db68695d5fd4c1e8de8003a400f7d6 (patch) | |
tree | 98f07c4cb84e54623ececa8d112404f65c499568 | |
parent | 042406a84a19568ab4e417e51eac9a632970c25e (diff) | |
download | libdbusmenu-9e5453bb93db68695d5fd4c1e8de8003a400f7d6.tar.gz libdbusmenu-9e5453bb93db68695d5fd4c1e8de8003a400f7d6.tar.bz2 libdbusmenu-9e5453bb93db68695d5fd4c1e8de8003a400f7d6.zip |
Make sure that if the callback is NULL we're not trying to get a callback
-rw-r--r-- | libdbusmenu-glib/client.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 78537f8..ed89d86 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -2035,11 +2035,15 @@ dbusmenu_client_send_about_to_show(DbusmenuClient * client, gint id, void (*cb)( priv->about_to_show_idle = g_idle_add(about_to_show_idle, client); } } else { + GAsyncReadyCallback dbuscb = NULL; + /* If there's no callback we don't need this data, let's clean it up in a consistent way */ if (cb == NULL) { about_to_show_finish(data, FALSE); data = NULL; + } else { + dbuscb = about_to_show_cb; } g_dbus_proxy_call(priv->menuproxy, @@ -2048,7 +2052,7 @@ dbusmenu_client_send_about_to_show(DbusmenuClient * client, gint id, void (*cb)( G_DBUS_CALL_FLAGS_NONE, -1, /* timeout */ NULL, /* cancellable */ - about_to_show_cb, + dbuscb, data); } |