diff --git a/Ocr/Latin.nocr b/Ocr/Latin.nocr index 8445a1fda..5cb070dc1 100644 Binary files a/Ocr/Latin.nocr and b/Ocr/Latin.nocr differ diff --git a/src/ui/Forms/Ocr/VobSubOcr.cs b/src/ui/Forms/Ocr/VobSubOcr.cs index 8042287ba..3af53e09c 100644 --- a/src/ui/Forms/Ocr/VobSubOcr.cs +++ b/src/ui/Forms/Ocr/VobSubOcr.cs @@ -5211,8 +5211,22 @@ namespace Nikse.SubtitleEdit.Forms.Ocr } else { - _abort = true; + SetButtonsEnabledAfterOcrDone(); _mainOcrSelectedIndices = null; + if (_tesseractThreadRunner != null && (_ocrMethodIndex == _ocrMethodTesseract5 || _ocrMethodIndex == _ocrMethodTesseract302)) + { + for (var i = 0; i < 100; i++) + { + System.Threading.Thread.Sleep(25); + _tesseractThreadRunner.CheckQueue(); + if (_tesseractThreadRunner.Count == 0) + { + break; + } + } + } + + return; } } else diff --git a/src/ui/Logic/Ocr/Tesseract/TesseractThreadRunner.cs b/src/ui/Logic/Ocr/Tesseract/TesseractThreadRunner.cs index dac653150..004c37d3a 100644 --- a/src/ui/Logic/Ocr/Tesseract/TesseractThreadRunner.cs +++ b/src/ui/Logic/Ocr/Tesseract/TesseractThreadRunner.cs @@ -80,6 +80,8 @@ namespace Nikse.SubtitleEdit.Logic.Ocr.Tesseract ThreadPool.QueueUserWorkItem(DoOcr, job); } + public int Count => _jobQueue.Count; + public void CheckQueue() { lock (QueueLock)