diff options
author | George Hazan <ghazan@miranda.im> | 2019-01-15 19:37:10 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-01-15 19:37:10 +0300 |
commit | 4491473110a95fe33b18334e828197974b141312 (patch) | |
tree | 7a207ba046db6217829f2a8458943187184a17ec /protocols | |
parent | 3f121d842f04dca0b195219d5205815d4e66ca5b (diff) |
ICQ10: fixes problem with multiple polling threads
also might fix #1769
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Icq10/src/server.cpp | 7 |
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) |