summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-07-20 16:52:19 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-07-23 17:37:53 +0200
commite4ccf5097e53695d130b1dbfe25c8384766162ad (patch)
tree33518f4cbacfc254e1fef2862ea0f66af6874654
parentaf04544218447141757cc7365aac8363b99cb9cf (diff)
downloadsink-e4ccf5097e53695d130b1dbfe25c8384766162ad.tar.gz
sink-e4ccf5097e53695d130b1dbfe25c8384766162ad.zip
Avoid warning about running jobs.
"Left jobs running while shutting down ResourceAccess", happens because the shutdown command destroys the instance before the method can clean up.
-rw-r--r--common/resourceaccess.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp
index 84c5dcb..c05d06c 100644
--- a/common/resourceaccess.cpp
+++ b/common/resourceaccess.cpp
@@ -421,10 +421,12 @@ bool ResourceAccess::processMessageBuffer()
421 421
422void ResourceAccess::callCallbacks(int id) 422void ResourceAccess::callCallbacks(int id)
423{ 423{
424 for(auto handler : d->resultHandler.values(id)) { 424 //We remove the callbacks first because the handler can kill resourceaccess directly
425 const auto callbacks = d->resultHandler.values(id);
426 d->resultHandler.remove(id);
427 for(auto handler : callbacks) {
425 handler(0, QString()); 428 handler(0, QString());
426 } 429 }
427 d->resultHandler.remove(id);
428} 430}
429 431
430void ResourceAccess::log(const QString &message) 432void ResourceAccess::log(const QString &message)