summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/ICQ-WIM')
-rw-r--r--protocols/ICQ-WIM/src/http.cpp11
-rw-r--r--protocols/ICQ-WIM/src/proto.h1
-rw-r--r--protocols/ICQ-WIM/src/server.cpp3
3 files changed, 13 insertions, 2 deletions
diff --git a/protocols/ICQ-WIM/src/http.cpp b/protocols/ICQ-WIM/src/http.cpp
index abc2af5996..9816c0d314 100644
--- a/protocols/ICQ-WIM/src/http.cpp
+++ b/protocols/ICQ-WIM/src/http.cpp
@@ -22,6 +22,17 @@
#pragma comment(lib, "Rpcrt4.lib")
+void CIcqProto::DropQueue()
+{
+ mir_cslock lck(m_csHttpQueue);
+
+ while (m_arHttpQueue.getCount()) {
+ auto *pReq = m_arHttpQueue[0];
+ m_arHttpQueue.remove(0);
+ delete pReq;
+ }
+}
+
bool CIcqProto::IsQueueEmpty()
{
mir_cslock lck(m_csHttpQueue);
diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h
index d48238a9d0..a30246ec19 100644
--- a/protocols/ICQ-WIM/src/proto.h
+++ b/protocols/ICQ-WIM/src/proto.h
@@ -349,6 +349,7 @@ class CIcqProto : public PROTO<CIcqProto>
LIST<AsyncHttpRequest> m_arHttpQueue;
void CalcHash(AsyncHttpRequest*);
+ void DropQueue();
bool ExecuteRequest(AsyncHttpRequest*);
bool IsQueueEmpty();
void Push(MHttpRequest*);
diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp
index 29528b9af1..68c4fecd05 100644
--- a/protocols/ICQ-WIM/src/server.cpp
+++ b/protocols/ICQ-WIM/src/server.cpp
@@ -579,8 +579,7 @@ void CIcqProto::ShutdownSession()
debugLogA("CIcqProto::ShutdownSession");
// shutdown all resources
- while (!IsQueueEmpty())
- Sleep(50);
+ DropQueue();
if (m_hWorkerThread)
SetEvent(m_evRequestsQueue);