Tidy up thread in destructor (Job)
[dcpomatic.git] / src / lib / job.cc
index 87e4fb3d370c783a99802eaf8dcc09e5e3a2af1c..784defc91736074e53292fdbcdb4c306341d7d6f 100644 (file)
@@ -53,6 +53,16 @@ Job::Job (shared_ptr<const Film> film)
 
 }
 
+Job::~Job ()
+{
+       if (_thread) {
+               _thread->interrupt ();
+               _thread->join ();
+       }
+
+       delete _thread;
+}
+
 /** Start the job in a separate thread, returning immediately */
 void
 Job::start ()