]> granicus.if.org Git - handbrake/commitdiff
MacGui: fix a possible race condition with the multiprocess queue when editing a...
authorDamiano Galassi <damiog@gmail.com>
Wed, 15 Mar 2017 15:31:57 +0000 (16:31 +0100)
committerDamiano Galassi <damiog@gmail.com>
Wed, 15 Mar 2017 15:31:57 +0000 (16:31 +0100)
macosx/HBQueueController.m

index 9219458ae3e1e834da312010a6c39db2b5dd0ba2..f6da396bb00825e5470417d0af06e6418ea159ea 100644 (file)
     NSParameterAssert(job);
     [self.jobs beginTransaction];
 
-    NSInteger index = [self.jobs indexOfObject:job];
-
     if (job != self.currentJob)
     {
         job.state = HBJobStateWorking;
             if (result)
             {
                 // Now that source is loaded and settings applied, delete the queue item from the queue
+                NSInteger index = [self.jobs indexOfObject:job];
                 [self removeQueueItemAtIndex:index];
             }
             else