Don't cancel finished jobs otherwise their finished callbacks will be called again.
[dcpomatic.git] / src / wx / text_panel.cc
index 95c422fd0c8dbf96f7db502616f2d4bff3dfe827..fa039dbde111f50111993a26de2232eca814b001 100644 (file)
@@ -826,7 +826,7 @@ TextPanel::try_to_load_analysis ()
 
        if (!boost::filesystem::exists(path)) {
                for (auto i: JobManager::instance()->get()) {
-                       if (dynamic_pointer_cast<AnalyseSubtitlesJob>(i)) {
+                       if (dynamic_pointer_cast<AnalyseSubtitlesJob>(i) && !i->finished()) {
                                i->cancel ();
                        }
                }