Don't start thread in constructor. (Writer)
[dcpomatic.git] / src / lib / writer.cc
index 9c4a194e806f02677f4caf4d76155aa2c79e0b09..0e15edeca0e8bbffdad0c5e09ce199faadaf7102 100644 (file)
@@ -148,12 +148,11 @@ Writer::Writer (shared_ptr<const Film> film, weak_ptr<Job> j)
        }
 
        job->sub (_("Encoding image data"));
+}
 
-       /* Do this last; if something after this line were to throw an exception
-          (say if Job::sub was interrupted by cancel) this thread would never
-          get properly cleaned up but the Writer object would go away underneath
-          it.
-       */
+void
+Writer::start ()
+{
        _thread = new boost::thread (boost::bind (&Writer::thread, this));
 }