From f38b1ee1bfca4a60519101c605b8c6025044c86d Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Thu, 4 Dec 2014 12:48:09 +0000 Subject: VKontakte: fix crash in PollServer on connection lost git-svn-id: http://svn.miranda-ng.org/main/trunk@11238 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_thread.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'protocols/VKontakte/src') 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); -- cgit v1.2.3