Skip to content

Commit

Permalink
Merge pull request #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 0497dc0 + a94943c commit a1a4575
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 a1a4575

Please sign in to comment.