[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kio/kio
From:       Andreas Hartmetz <ahartmetz () gmail ! com>
Date:       2010-01-19 18:08:11
Message-ID: 1263924491.158296.1278.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1077219 by ahartmetz:

Make sure that we never call Scheduler::cancelJob() twice for the same job, even if \
client code is doing something wrong.

 M  +7 -2      job.cpp  
 M  +2 -1      job_p.h  


--- trunk/KDE/kdelibs/kio/kio/job.cpp #1077218:1077219
@@ -311,8 +311,13 @@
 
 bool SimpleJob::doKill()
 {
-    //kDebug() << this;
-    Scheduler::cancelJob(this); // deletes the slave if not 0
+    Q_D(SimpleJob);
+    if ((d->m_extraFlags & JobPrivate::EF_KillCalled) == 0) {
+        d->m_extraFlags |= JobPrivate::EF_KillCalled;
+        Scheduler::cancelJob(this); // deletes the slave if not 0
+    } else {
+        kWarning(7007) << "This is overkill.";
+    }
     return Job::doKill();
 }
 
--- trunk/KDE/kdelibs/kio/kio/job_p.h #1077218:1077219
@@ -47,7 +47,8 @@
         enum { EF_TransferJobAsync    = (1 << 0),
                EF_TransferJobNeedData = (1 << 1),
                EF_TransferJobDataSent = (1 << 2),
-               EF_ListJobUnrestricted = (1 << 3) };
+               EF_ListJobUnrestricted = (1 << 3),
+               EF_KillCalled          = (1 << 4) };
 
         // Maybe we could use the QObject parent/child mechanism instead
         // (requires a new ctor, and moving the ctor code to some init()).


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic