Don't cancel finished jobs otherwise their finished callbacks will be called again.
authorCarl Hetherington <cth@carlh.net>
Sat, 21 Jan 2023 21:29:29 +0000 (22:29 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 27 Feb 2023 13:47:25 +0000 (14:47 +0100)
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 ();
                        }
                }