Skip to content

Commit

Permalink
Merge pull request tesseract-ocr#6 from jimregan/gcode_issue1316
Browse files Browse the repository at this point in the history
Issue 1316: The traineddata file must be closed after it was opened
  • Loading branch information
zdenop authored Aug 29, 2016
2 parents 920da05 + 941575b commit 7da94d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dict/dawg_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
return NULL;
}
FILE *fp = data_loader.GetDataFilePtr();
DawgType dawg_type;
PermuterType perm_type;
Expand Down

0 comments on commit 7da94d0

Please sign in to comment.