e/connman: discard previous message if a new arrives

SVN revision: 76069
This commit is contained in:
Lucas De Marchi 2012-09-03 22:05:55 +00:00
parent 893d7160a0
commit 11aeb5322d
1 changed files with 6 additions and 0 deletions

View File

@ -391,11 +391,16 @@ _agent_request_input(E_DBus_Object *obj, DBusMessage *msg)
const char *path;
agent = e_dbus_object_data_get(obj);
/* Discard previous requests */
if (agent->msg)
dbus_message_unref(agent->msg);
agent->msg = dbus_message_ref(msg);
if (agent->dialog)
_dialog_del(agent->dialog);
agent->dialog = _dialog_new(agent);
EINA_SAFETY_ON_NULL_GOTO(agent->dialog, err);
dbus_message_iter_init(msg, &iter);
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_OBJECT_PATH)
@ -441,6 +446,7 @@ _agent_request_input(E_DBus_Object *obj, DBusMessage *msg)
err:
dbus_message_unref(msg);
agent->msg = NULL;
WRN("Failed to parse msg");
reply = dbus_message_new_method_return(msg);
return reply;