diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-07-20 16:52:19 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-07-23 17:37:53 +0200 |
commit | e4ccf5097e53695d130b1dbfe25c8384766162ad (patch) | |
tree | 33518f4cbacfc254e1fef2862ea0f66af6874654 /common/resourceaccess.cpp | |
parent | af04544218447141757cc7365aac8363b99cb9cf (diff) | |
download | sink-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.
Diffstat (limited to 'common/resourceaccess.cpp')
-rw-r--r-- | common/resourceaccess.cpp | 6 |
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 | ||
422 | void ResourceAccess::callCallbacks(int id) | 422 | void 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 | ||
430 | void ResourceAccess::log(const QString &message) | 432 | void ResourceAccess::log(const QString &message) |