summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-12-04 12:48:09 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-12-04 12:48:09 +0000
commitf38b1ee1bfca4a60519101c605b8c6025044c86d (patch)
treebad5eae749f8efce9b69844dead63e42d2147617
parent8c59441b579c7f7a23668a059ca1366d6ff864b3 (diff)
VKontakte: fix crash in PollServer on connection lost
git-svn-id: http://svn.miranda-ng.org/main/trunk@11238 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index 3cb1de29e9..78c9f34cb9 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -898,9 +898,8 @@ int CVkProto::PollServer()
break;
debugLogA("CVkProto::PollServer is dead");
m_pollingConn = NULL;
- if (iPollConnRetry && !m_bTerminated){
- iPollConnRetry--;
- debugLogA("CVkProto::PollServer restarting %d", MAX_RETRIES - iPollConnRetry);
+ if (iPollConnRetry && !m_bTerminated){
+ debugLogA("CVkProto::PollServer restarting %d", MAX_RETRIES - iPollConnRetry + 1);
Sleep(1000);
}
else {
@@ -908,7 +907,7 @@ int CVkProto::PollServer()
ShutdownSession();
return 0;
}
- } while (iPollConnRetry && !m_bTerminated);
+ } while(!m_bTerminated && iPollConnRetry--);
mir_free(szUrl);