From d0ecf4ae8830531b9402fe804996026ce430655f Mon Sep 17 00:00:00 2001 From: Andreas Hartmetz Date: Fri, 9 Oct 2009 09:33:20 +0000 Subject: [PATCH] This hopefully fixes a double delete bug. I don't see what would prevent both RunnerManager::jobDone() and DelayedJobCleaner::jobDone() from being invoked if the JobDone() signal is emitted just at the right (wrong) time. Both jobDone() slots delete (as in delete operator) the job. CCMAIL:aseigo@kde.org svn path=/trunk/KDE/kdelibs/; revision=1033035 --- private/runnerjobs.cpp | 2 +- runnermanager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/private/runnerjobs.cpp b/private/runnerjobs.cpp index deb4c48dc..07862ca56 100644 --- a/private/runnerjobs.cpp +++ b/private/runnerjobs.cpp @@ -190,7 +190,7 @@ void DelayedJobCleaner::jobDone(ThreadWeaver::Job *job) } m_jobs.remove(runJob); - delete runJob; + runJob->deleteLater(); if (m_jobs.isEmpty()) { deleteLater(); diff --git a/runnermanager.cpp b/runnermanager.cpp index fd564d03d..a5a800608 100644 --- a/runnermanager.cpp +++ b/runnermanager.cpp @@ -191,13 +191,13 @@ public: if (deferredRun.isEnabled() && runJob->runner() == deferredRun.runner()) { //kDebug() << "job actually done, running now **************"; QueryMatch tmpRun = deferredRun; - deferredRun = QueryMatch(0); + deferredRun = QueryMatch(0); tmpRun.run(context); } searchJobs.remove(runJob); oldSearchJobs.remove(runJob); - delete runJob; + runJob->deleteLater(); if (searchJobs.isEmpty() && context.matches().isEmpty()) { // we finished our run, and there are no valid matches, and so no