From 059aa7f83221802103abf7f66b0ff7942c8d0c6c Mon Sep 17 00:00:00 2001 From: Andreas Date: Mon, 4 May 2015 16:25:49 +0200 Subject: [PATCH] Move `watcher->deleteLater();` at the end of the `BlockingSearchFinished()` function to ensure the `watcher` object is still available when emitting the signals. --- src/globalsearch/searchprovider.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/globalsearch/searchprovider.cpp b/src/globalsearch/searchprovider.cpp index da6acb51e..3a74021c4 100644 --- a/src/globalsearch/searchprovider.cpp +++ b/src/globalsearch/searchprovider.cpp @@ -89,11 +89,12 @@ void BlockingSearchProvider::SearchAsync(int id, const QString& query) { void BlockingSearchProvider::BlockingSearchFinished() { BoundFutureWatcher* watcher = static_cast*>(sender()); - watcher->deleteLater(); const int id = watcher->data(); emit ResultsAvailable(id, watcher->result()); emit SearchFinished(id); + + watcher->deleteLater(); } QImage SearchProvider::ScaleAndPad(const QImage& image) {