diff options
author | Ted Gould <ted@gould.cx> | 2012-02-15 11:15:26 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2012-02-15 11:15:26 -0600 |
commit | 3b10914731600de2ff962849ba1f56ecdb646b77 (patch) | |
tree | f96691e5c0f1a0a62708ea6abdcace0e01c74950 /libdbusmenu-glib | |
parent | b3341dfd9487fc4617a8af539e99123aa4624c42 (diff) | |
parent | 29a58948a274ca3cff7da3b32ad97d47cef012c8 (diff) | |
download | libdbusmenu-3b10914731600de2ff962849ba1f56ecdb646b77.tar.gz libdbusmenu-3b10914731600de2ff962849ba1f56ecdb646b77.tar.bz2 libdbusmenu-3b10914731600de2ff962849ba1f56ecdb646b77.zip |
Ensure that we only return once even with error
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/server.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index c992085..4700d52 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -1609,7 +1609,6 @@ bus_event (DbusmenuServer * server, GVariant * params, GDBusMethodInvocation * i DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, id); if (mi == NULL) { - g_dbus_method_invocation_return_error(invocation, error_quark(), INVALID_MENUITEM_ID, @@ -1619,17 +1618,17 @@ bus_event (DbusmenuServer * server, GVariant * params, GDBusMethodInvocation * i g_variant_unref(data); } else { - idle_event_t * event_data = g_new0(idle_event_t, 1); event_data->mi = g_object_ref(mi); - event_data->eventid = etype; + event_data->eventid = etype; /* give away our allocation */ event_data->timestamp = ts; event_data->variant = data; /* give away our reference */ g_timeout_add(0, event_local_handler, event_data); + + g_dbus_method_invocation_return_value(invocation, NULL); } - g_dbus_method_invocation_return_value(invocation, NULL); return; } |