Cleanup: set job state to cancelled in a different place.
[dcpomatic.git] / src / lib / job.cc
index 50dcc336e2fd9029b3d659246165e06d3e303f10..5bed3f0d273c6b5216ce2bb0c67b3b52c3953db2 100644 (file)
@@ -199,9 +199,7 @@ Job::run_wrapper ()
                set_state (FINISHED_ERROR);
 
        } catch (boost::thread_interrupted &) {
-
-               set_state (FINISHED_CANCELLED);
-
+               /* The job was cancelled; there's nothing else we need to do here */
        } catch (sub::SubripError& e) {
 
                string extra = "Error is near:\n";
@@ -601,6 +599,8 @@ Job::cancel ()
 
        _thread.interrupt ();
        _thread.join ();
+
+       set_state (FINISHED_CANCELLED);
 }