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 28c1f57 + a371ab5 commit 5f253c9
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 5f253c9

Please sign in to comment.