summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-07-25 08:54:40 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-07-25 08:54:40 +0200
commitda95c85de0b9f9b760845cc4b9911b79fbaafe9a (patch)
tree2d747c5c255be7a534da9a985a3cb966e2fae034
parent460e57b642172f279e8faebeb7a02451cbf31dce (diff)
downloadsink-da95c85de0b9f9b760845cc4b9911b79fbaafe9a.tar.gz
sink-da95c85de0b9f9b760845cc4b9911b79fbaafe9a.zip
Fixed crash.
Could be triggered by running the composerviewtest in kube.
-rw-r--r--common/store.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/store.cpp b/common/store.cpp
index 0328c7f..b68cb68 100644
--- a/common/store.cpp
+++ b/common/store.cpp
@@ -312,8 +312,11 @@ KAsync::Job<void> Store::removeDataFromDisk(const QByteArray &identifier)
312 .then<void>([resourceAccess](KAsync::Future<void> &future) { 312 .then<void>([resourceAccess](KAsync::Future<void> &future) {
313 if (resourceAccess->isReady()) { 313 if (resourceAccess->isReady()) {
314 //Wait for the resource shutdown 314 //Wait for the resource shutdown
315 QObject::connect(resourceAccess.data(), &ResourceAccess::ready, [&future](bool ready) { 315 auto guard = new QObject;
316 QObject::connect(resourceAccess.data(), &ResourceAccess::ready, guard, [&future, guard](bool ready) {
316 if (!ready) { 317 if (!ready) {
318 //We don't disconnect if ResourceAccess get's recycled, so ready can fire multiple times, which can result in a crash if the future is no longer valid.
319 delete guard;
317 future.setFinished(); 320 future.setFinished();
318 } 321 }
319 }); 322 });