diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-01-10 11:29:16 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-01-10 11:29:16 +0000 |
commit | ac3b68411027e5bcfee79af0c4fb848f3fdcbee8 (patch) | |
tree | b820b98323143f1c9869899c9320946983eb8dda /protocols/VKontakte/src/vk_proto.cpp | |
parent | bbd287fc6623197101227c820379a3b5ef4358f7 (diff) |
VKontakte: fix(???) for crash on fast posting
git-svn-id: http://svn.miranda-ng.org/main/trunk@11810 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_proto.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index eb92fa0504..f3881cd76a 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -510,6 +510,10 @@ int CVkProto::SendMsg(MCONTACT hContact, int flags, const char *msg) void CVkProto::OnSendMessage(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
{
int iResult = ACKRESULT_FAILED;
+ if (pReq->pUserInfo == NULL){
+ debugLogA("CVkProto::OnSendMessage failed! (pUserInfo == NULL)");
+ return;
+ }
CVkSendMsgParam *param = (CVkSendMsgParam*)pReq->pUserInfo;
debugLogA("CVkProto::OnSendMessage %d", reply->resultCode);
@@ -531,12 +535,16 @@ void CVkProto::OnSendMessage(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) if (param->iMsgID == -1) {
CVkFileUploadParam *fup = (CVkFileUploadParam *)param->iCount;
ProtoBroadcastAck(fup->hContact, ACKTYPE_FILE, iResult, (HANDLE)fup, 0);
- delete fup;
+ if (!pReq->bNeedsRestart)
+ delete fup;
return;
}
else if (m_bServerDelivery)
ProtoBroadcastAck(param->hContact, ACKTYPE_MESSAGE, iResult, HANDLE(param->iMsgID), 0);
- delete param;
+ if (!pReq->bNeedsRestart){
+ delete param;
+ pReq->pUserInfo = NULL;
+ }
}
//////////////////////////////////////////////////////////////////////////////
@@ -665,7 +673,8 @@ void CVkProto::OnReceiveAuthRequest(NETLIBHTTPREQUEST *reply, AsyncHttpRequest * }
}
}
- delete param;
+ if (!pReq->bNeedsRestart)
+ delete param;
}
int CVkProto::Authorize(HANDLE hDbEvent)
|