summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/request_queue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/SkypeWeb/src/request_queue.cpp')
-rw-r--r--protocols/SkypeWeb/src/request_queue.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/protocols/SkypeWeb/src/request_queue.cpp b/protocols/SkypeWeb/src/request_queue.cpp
index a2c125e0c4..84d725aba4 100644
--- a/protocols/SkypeWeb/src/request_queue.cpp
+++ b/protocols/SkypeWeb/src/request_queue.cpp
@@ -26,6 +26,11 @@ RequestQueue::RequestQueue(HNETLIBUSER _nlu) :
RequestQueue::~RequestQueue()
{
+ if (hRequestQueueThread) {
+ WaitForSingleObject(hRequestQueueThread, INFINITE);
+ hRequestQueueThread = nullptr;
+ }
+
requests.destroy();
}
@@ -92,8 +97,11 @@ unsigned int RequestQueue::WorkerThread(void *arg)
{
RequestQueue *queue = (RequestQueue*)arg;
- while (!queue->isTerminated) {
+ while (true) {
queue->hRequestQueueEvent.Wait();
+ if (queue->isTerminated)
+ break;
+
while (true) {
RequestQueueItem *item = NULL;
{