diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-09-07 15:30:02 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-09-07 15:30:02 +0000 |
commit | c76cb483df20f8058deedcf5500b20ea5af98cf6 (patch) | |
tree | f8037ae70e781efbde6d56864c7cb9b9f508e15c /protocols/VKontakte/src/vk_proto.cpp | |
parent | 19dbdd9ae7fd04bde5d5761bce97344842d2a6d9 (diff) |
VKontakte:
code refactoring
fix memory leaks and corruption
fix for support MessageState
version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@15294 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_proto.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index f8d555a907..d334c71cbc 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -544,7 +544,7 @@ void CVkProto::OnReceiveAuthRequest(NETLIBHTTPREQUEST *reply, AsyncHttpRequest * {
debugLogA("CVkProto::OnReceiveAuthRequest %d", reply->resultCode);
CVkSendMsgParam *param = (CVkSendMsgParam*)pReq->pUserInfo;
- if (reply->resultCode == 200) {
+ if (reply->resultCode == 200 && param) {
JSONNode jnRoot;
const JSONNode &jnResponse = CheckJsonResponse(pReq, reply, jnRoot);
if (jnResponse) {
@@ -560,7 +560,7 @@ void CVkProto::OnReceiveAuthRequest(NETLIBHTTPREQUEST *reply, AsyncHttpRequest * }
}
else {
- switch (param->iCount) {
+ switch (pReq->m_iErrorCode) {
case VKERR_HIMSELF_AS_FRIEND:
MsgPopup(param->hContact, TranslateT("You cannot add yourself as friend"), TranslateT("Error"), true);
break;
@@ -573,8 +573,11 @@ void CVkProto::OnReceiveAuthRequest(NETLIBHTTPREQUEST *reply, AsyncHttpRequest * }
}
}
- if (!pReq->bNeedsRestart)
+
+ if (param && (!pReq->bNeedsRestart || m_bTerminated)) {
delete param;
+ pReq->pUserInfo = NULL;
+ }
}
int CVkProto::Authorize(MEVENT hDbEvent)
|