Issue 1316: The traineddata file must be closed after it was opened

This commit is contained in:
oriahulrich@microvu.com 2014-09-18 16:43:28 +01:00 committed by Jim O'Regan
parent b13691fda0
commit d3252f926e

View File

@ -60,7 +60,10 @@ Dawg *DawgLoader::Load() {
if (!data_loader.Init(data_file_name_, dawg_debug_level_)) {
return NULL;
}
if (!data_loader.SeekToStart(tessdata_dawg_type_)) return NULL;
if (!data_loader.SeekToStart(tessdata_dawg_type_)) {
data_loader.End(); /// Must close the file
return NULL;
}
FILE *fp = data_loader.GetDataFilePtr();
DawgType dawg_type;
PermuterType perm_type;