X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fjob.cc;h=8ce63ced0213d66ea2c03dce79bd3a29579562d0;hp=50dcc336e2fd9029b3d659246165e06d3e303f10;hb=345df3ae8254f25299c2fc2022b1143d444f9a56;hpb=d311043bf3c1e3e7f41b314f7ab7c91ed7e5aa7f diff --git a/src/lib/job.cc b/src/lib/job.cc index 50dcc336e..8ce63ced0 100644 --- a/src/lib/job.cc +++ b/src/lib/job.cc @@ -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"; @@ -237,6 +235,12 @@ Job::run_wrapper () set_progress (1); set_state (FINISHED_ERROR); + } catch (CPLNotFoundError& e) { + + set_error(e.what()); + set_progress(1); + set_state(FINISHED_ERROR); + } catch (std::exception& e) { set_error ( @@ -591,16 +595,14 @@ Job::remaining_time () const void Job::cancel () { - if (!_thread.joinable()) { - return; - } + if (_thread.joinable()) { + resume(); - if (paused_by_user() || paused_by_priority()) { - resume (); + _thread.interrupt (); + _thread.join (); } - _thread.interrupt (); - _thread.join (); + set_state (FINISHED_CANCELLED); }