Closed GoogleCodeExporter closed 9 years ago
in presenceouttask.cc
XmppReturnStatus PresenceOutTask::SendProbe(const Jid & jid) {
if (GetState() != STATE_INIT && GetState() != STATE_START)
return XMPP_RETURN_BADSTATE;
XmlElement * presence = new XmlElement(QN_PRESENCE);
presence->AddAttr(QN_TO, jid.Str());
presence->AddAttr(QN_TYPE, "probe");
QueueStanza(presence);
delete presence;
return XMPP_RETURN_OK;
}
As you can see after queueing stanze it(presence) is deleted.
but in other task, after queueing stanze, it is never deleted.
in mucinvitesendtask.cc --no delete operation
XmppReturnStatus
MucInviteSendTask::Send(const Jid& to, const Jid& invitee) {
if (GetState() != STATE_INIT && GetState() != STATE_START)
return XMPP_RETURN_BADSTATE;
XmlElement* message = new XmlElement(QN_MESSAGE);
message->AddAttr(QN_TO, to.Str());
XmlElement* xstanza = new XmlElement(QN_MUC_USER_X);
XmlElement* invite = new XmlElement(QN_MUC_USER_INVITE);
invite->AddAttr(QN_TO, invitee.Str());
xstanza->AddElement(invite);
message->AddElement(xstanza);
QueueStanza(message);
return XMPP_RETURN_OK;
}
Original comment by adam1988...@gmail.com
on 20 Jan 2012 at 9:23
These problems were already commented on issue 246. The comment #2 points the
same problem in another class (As I commented on issue 246,
MucInviteSendTask::Send and FriendInviteSendTask::Send also have this problem).
Adam, the example you gave (PresenceOutTask::SendProbe) was actually fixed
after my comment on issue 246, but many other were left behind, so I think
every stanza sender class should be checked.
Original comment by diego.cd...@gmail.com
on 20 Jan 2012 at 10:46
Original comment by jun...@google.com
on 10 Feb 2012 at 12:54
Original issue reported on code.google.com by
adam1988...@gmail.com
on 20 Jan 2012 at 9:03