From 09596e3732dd5d384fd0f231bef92f3e6ceef2cc Mon Sep 17 00:00:00 2001 From: Arnaud Bienner Date: Thu, 30 Aug 2012 00:01:28 +0200 Subject: [PATCH] Don't get stuck when exiting Clementine while library is being created/updated --- ext/libclementine-common/core/workerpool.h | 4 ++++ src/library/library.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/libclementine-common/core/workerpool.h b/ext/libclementine-common/core/workerpool.h index 53beec8d6..b4ac19e9b 100644 --- a/ext/libclementine-common/core/workerpool.h +++ b/ext/libclementine-common/core/workerpool.h @@ -191,6 +191,10 @@ WorkerPool::~WorkerPool() { } } } + + foreach (ReplyType* reply, message_queue_) { + reply->Abort(); + } } template diff --git a/src/library/library.cpp b/src/library/library.cpp index 3387ad026..4c93ed426 100644 --- a/src/library/library.cpp +++ b/src/library/library.cpp @@ -101,7 +101,7 @@ Library::Library(Application* app, QObject *parent) Library::~Library() { watcher_->deleteLater(); watcher_thread_->exit(); - watcher_thread_->wait(); + watcher_thread_->wait(5000 /* five seconds */); } void Library::Init() {