From e4ccf5097e53695d130b1dbfe25c8384766162ad Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 20 Jul 2015 16:52:19 +0200 Subject: 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. --- common/resourceaccess.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'common') 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() void ResourceAccess::callCallbacks(int id) { - for(auto handler : d->resultHandler.values(id)) { + //We remove the callbacks first because the handler can kill resourceaccess directly + const auto callbacks = d->resultHandler.values(id); + d->resultHandler.remove(id); + for(auto handler : callbacks) { handler(0, QString()); } - d->resultHandler.remove(id); } void ResourceAccess::log(const QString &message) -- cgit v1.2.3