diff options
-rw-r--r-- | common/resourceaccess.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index fdef6f2..dab6335 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp | |||
@@ -125,8 +125,9 @@ void ResourceAccess::Private::abortPendingOperations() | |||
125 | 125 | ||
126 | void ResourceAccess::Private::callCallbacks() | 126 | void ResourceAccess::Private::callCallbacks() |
127 | { | 127 | { |
128 | for (auto id : completeCommands.keys()) { | 128 | const auto commandIds = completeCommands.keys(); |
129 | const bool success = completeCommands.value(id); | 129 | for (auto id : commandIds) { |
130 | const bool success = completeCommands.take(id); | ||
130 | // We remove the callbacks first because the handler can kill resourceaccess directly | 131 | // We remove the callbacks first because the handler can kill resourceaccess directly |
131 | const auto callbacks = resultHandler.values(id); | 132 | const auto callbacks = resultHandler.values(id); |
132 | resultHandler.remove(id); | 133 | resultHandler.remove(id); |