From bb0a4f168ea59d6afdfbe9a5c9473ef1ee6f37ad Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 20 Jul 2010 11:26:08 -0500 Subject: Add a check to protect against adding the same ID twice to the queue. --- libdbusmenu-glib/client.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 1c962dd..e962f78 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -509,6 +509,14 @@ static void get_properties_globber (DbusmenuClient * client, gint id, const gchar ** properties, org_ayatana_dbusmenu_get_properties_reply callback, gpointer user_data) { DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client); + if (find_listener(priv->delayed_property_listeners, 0, id) != NULL) { + g_warning("Asking for properties from same ID twice: %d", id); + GError * localerror = NULL; + g_set_error_literal(&localerror, 0, 0, "ID already queued"); + callback(priv->menuproxy, NULL, localerror, user_data); + g_error_free(localerror); + return; + } if (properties == NULL || properties[0] == NULL) { /* get all case */ -- cgit v1.2.3