Move `watcher->deleteLater();` at the end of the `BlockingSearchFinished()` function to ensure the `watcher` object is still available when emitting the signals.

This commit is contained in:
Andreas 2015-05-04 16:25:49 +02:00
parent 28fb6e5fcb
commit 059aa7f832
1 changed files with 2 additions and 1 deletions

View File

@ -89,11 +89,12 @@ void BlockingSearchProvider::SearchAsync(int id, const QString& query) {
void BlockingSearchProvider::BlockingSearchFinished() {
BoundFutureWatcher<ResultList, int>* watcher =
static_cast<BoundFutureWatcher<ResultList, int>*>(sender());
watcher->deleteLater();
const int id = watcher->data();
emit ResultsAvailable(id, watcher->result());
emit SearchFinished(id);
watcher->deleteLater();
}
QImage SearchProvider::ScaleAndPad(const QImage& image) {