summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-01-15 19:37:10 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-01-15 19:37:10 +0300
commit4491473110a95fe33b18334e828197974b141312 (patch)
tree7a207ba046db6217829f2a8458943187184a17ec
parent3f121d842f04dca0b195219d5205815d4e66ca5b (diff)
ICQ10: fixes problem with multiple polling threads
also might fix #1769
-rw-r--r--protocols/Icq10/src/server.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/protocols/Icq10/src/server.cpp b/protocols/Icq10/src/server.cpp
index adf862eedb..4c440b9670 100644
--- a/protocols/Icq10/src/server.cpp
+++ b/protocols/Icq10/src/server.cpp
@@ -372,11 +372,11 @@ void CIcqProto::ShutdownSession()
if (m_hWorkerThread)
SetEvent(m_evRequestsQueue);
+ OnLoggedOut();
+
for (auto &it : m_ConnPool)
if (it.s)
Netlib_Shutdown(it.s);
-
- OnLoggedOut();
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -540,7 +540,8 @@ void CIcqProto::OnStartSession(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest*)
for (auto &it : data["events"])
ProcessEvent(it);
- m_hPollThread = ForkThreadEx(&CIcqProto::PollThread, 0, 0);
+ if (m_hPollThread == nullptr)
+ m_hPollThread = ForkThreadEx(&CIcqProto::PollThread, 0, 0);
}
void CIcqProto::OnReceiveAvatar(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pReq)