Destory TranscodeJob earlier, hopefully to fix #1570.
[dcpomatic.git] / src / lib / transcode_job.cc
index 356e862e0c87bb14de9d00d4ff7a6935abdfc5b2..981816fd528f24edc19e071cf37526c88f37b714 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -51,6 +51,14 @@ TranscodeJob::TranscodeJob (shared_ptr<const Film> film)
 
 }
 
+TranscodeJob::~TranscodeJob ()
+{
+       /* We have to stop the job thread here as we're about to start tearing down
+          the Encoder, which is bad news if the job thread is still feeding it data.
+       */
+       stop_thread ();
+}
+
 string
 TranscodeJob::name () const
 {