Please help me, how to fix this bug.
I use API Skype for Linux to get Skype fullname but sometime I have bug from Dbus "
Message has the same reply serial as a currently-outstanding existing method call" after my program is terminated (segmentation fault).
int
skype_get_fullname(DBusConnection *connection, char *skypeid)
{
char *command;
char *result;
asprintf(&command, "GET USER %s FULLNAME", skypeid);
result = skype_send(connection, command);
if(result)
free(result);
free(command);
return TRUE; /* Check for errors... */
}
this fucntion sends command to get Skype Fullname
dbus_bool_t
bus_connections_expect_reply (BusConnections *connections,
BusTransaction *transaction,
DBusConnection *will_get_reply,
DBusConnection *will_send_reply,
DBusMessage *reply_to_this,
DBusError *error)
{
BusPendingReply *pending;
dbus_uint32_t reply_serial;
DBusList *link;
CancelPendingReplyData *cprd;
int count;
_dbus_assert (will_get_reply != NULL);
_dbus_assert (will_send_reply != NULL);
_dbus_assert (reply_to_this != NULL);
if (dbus_message_get_no_reply (reply_to_this))
return TRUE; /* we won't allow a reply, since client doesn't care for one. */
reply_serial = dbus_message_get_serial (reply_to_this);
link = _dbus_list_get_first_link (&connections->pending_replies->items);
count = 0;
while (link != NULL)
{
pending = link->data;
if (pending->reply_serial == reply_serial &&
pending->will_get_reply == will_get_reply &&
pending->will_send_reply == will_send_reply)
{
dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
"Message has the same reply serial as a currently-outstanding existing method call");
// return FALSE;
}
link = _dbus_list_get_next_link (&connections->pending_replies->items,
link);
++count;
}
...........
Thanks !