d588620e70bf15da29cc242e4ae8d86977e8f36a from master; fix hang if you cancel a paused...
[dcpomatic.git] / src / lib / job.cc
index f281466325f8c34a7e78d8e0ad8229910335946b..286b38456a8c0b82891e67d8b698cfaf4fedde64 100644 (file)
@@ -27,7 +27,6 @@
 #include "job.h"
 #include "util.h"
 #include "cross.h"
-#include "ui_signaller.h"
 #include "exceptions.h"
 #include "film.h"
 #include "log.h"
@@ -239,6 +238,9 @@ Job::set_progress (float p, bool force)
                _pause_changed.wait (lm2);
        }
 
+       lm.unlock ();
+       lm2.unlock ();
+
        emit (boost::bind (boost::ref (Progress)));
 }
 
@@ -377,6 +379,10 @@ Job::cancel ()
                return;
        }
 
+       if (paused ()) {
+               resume ();
+       }
+
        _thread->interrupt ();
        _thread->join ();
 }