From 9e5453bb93db68695d5fd4c1e8de8003a400f7d6 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 4 Apr 2012 23:07:16 -0500 Subject: Make sure that if the callback is NULL we're not trying to get a callback --- libdbusmenu-glib/client.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libdbusmenu-glib') 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); } -- cgit v1.2.3