From 218093c4677a95c0c2232321a8a8c00baa40fb61 Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Tue, 3 Mar 2009 02:07:19 +0000 Subject: [PATCH] Prevents a deadlock when dealing with a deferredRun BUG: 181057 svn path=/trunk/KDE/kdelibs/; revision=934417 --- runnermanager.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/runnermanager.cpp b/runnermanager.cpp index b7b18bbd5..7efa7bdd1 100644 --- a/runnermanager.cpp +++ b/runnermanager.cpp @@ -163,8 +163,9 @@ public: FindMatchesJob *runJob = static_cast(job); if (deferredRun.isEnabled() && runJob->runner() == deferredRun.runner()) { //kDebug() << "job actually done, running now **************"; - deferredRun.run(context); - deferredRun = QueryMatch(0); + QueryMatch tmpRun = deferredRun; + deferredRun = QueryMatch(0); + tmpRun.run(context); } searchJobs.removeAll(runJob); delete runJob; @@ -270,10 +271,12 @@ void RunnerManager::run(const QueryMatch &match) } } - match.run(d->context); - if (d->deferredRun.isValid()) { d->deferredRun = QueryMatch(0); + + match.run(d->context); + + } } @@ -400,8 +403,9 @@ void RunnerManager::reset() if (d->deferredRun.isEnabled()) { //kDebug() << "job actually done, running now **************"; - d->deferredRun.run(d->context); + QueryMatch tmpRun = d->deferredRun; d->deferredRun = QueryMatch(0); + tmpRun.run(d->context); } d->context.reset();