std::shared_ptr
[dcpomatic.git] / src / lib / hints.cc
index 13154803579eb5a9379b872471a573c367ca8c1b..e52e448cf0cd2b2e1011f05b07fdcd013634ce62 100644 (file)
@@ -27,6 +27,7 @@
 #include "text_content.h"
 #include "audio_processor.h"
 #include "font.h"
+#include "font_data.h"
 #include "ratio.h"
 #include "audio_analysis.h"
 #include "compose.hpp"
@@ -51,8 +52,8 @@ using std::pair;
 using std::min;
 using std::max;
 using std::cout;
-using boost::shared_ptr;
-using boost::weak_ptr;
+using std::shared_ptr;
+using std::weak_ptr;
 using boost::optional;
 using boost::bind;
 using namespace dcpomatic;
@@ -390,7 +391,15 @@ Hints::thread ()
 
        boost::filesystem::path dcp_dir = film->dir("hints") / dcpomatic::get_process_id();
        boost::filesystem::remove_all (dcp_dir);
-       _writer->finish (film->dir("hints") / dcpomatic::get_process_id());
+
+       try {
+               _writer->finish (film->dir("hints") / dcpomatic::get_process_id());
+       } catch (...) {
+               store_current ();
+               emit (bind(boost::ref(Finished)));
+               return;
+       }
+
        dcp::DCP dcp (dcp_dir);
        dcp.read ();
        DCPOMATIC_ASSERT (dcp.cpls().size() == 1);