Prevents a deadlock when dealing with a deferredRun

BUG: 181057

svn path=/trunk/KDE/kdelibs/; revision=934417
This commit is contained in:
Jacopo De Simoi 2009-03-03 02:07:19 +00:00
parent 3f50ffd7ce
commit 218093c467

View File

@ -163,8 +163,9 @@ public:
FindMatchesJob *runJob = static_cast<FindMatchesJob*>(job); FindMatchesJob *runJob = static_cast<FindMatchesJob*>(job);
if (deferredRun.isEnabled() && runJob->runner() == deferredRun.runner()) { if (deferredRun.isEnabled() && runJob->runner() == deferredRun.runner()) {
//kDebug() << "job actually done, running now **************"; //kDebug() << "job actually done, running now **************";
deferredRun.run(context); QueryMatch tmpRun = deferredRun;
deferredRun = QueryMatch(0); deferredRun = QueryMatch(0);
tmpRun.run(context);
} }
searchJobs.removeAll(runJob); searchJobs.removeAll(runJob);
delete runJob; delete runJob;
@ -270,10 +271,12 @@ void RunnerManager::run(const QueryMatch &match)
} }
} }
match.run(d->context);
if (d->deferredRun.isValid()) { if (d->deferredRun.isValid()) {
d->deferredRun = QueryMatch(0); d->deferredRun = QueryMatch(0);
match.run(d->context);
} }
} }
@ -400,8 +403,9 @@ void RunnerManager::reset()
if (d->deferredRun.isEnabled()) { if (d->deferredRun.isEnabled()) {
//kDebug() << "job actually done, running now **************"; //kDebug() << "job actually done, running now **************";
d->deferredRun.run(d->context); QueryMatch tmpRun = d->deferredRun;
d->deferredRun = QueryMatch(0); d->deferredRun = QueryMatch(0);
tmpRun.run(d->context);
} }
d->context.reset(); d->context.reset();