kareemu3 / tesseract-ocr

Automatically exported from code.google.com/p/tesseract-ocr
Other
0 stars 0 forks source link

config files not closed #1349

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run "... api->Init(); ... delete api;" multiple times (500+) in one process.
2. After some number of iterations you will see errors "read_params_file: Can't 
open ..." in stdout.

What is the expected output? What do you see instead?
Correct closing config files after Init().

What version of the product are you using? On what operating system?
tesseract-ocr 3.02.02, Windows 7 64bit.

Please provide any additional information below.
Fix file closing (fclose) in ccutil/params.cpp in method 
ParamUtils::ReadParamsFile() - fclose() must be called before return statement, 
not after.

Original issue reported on code.google.com by turk...@gmail.com on 21 Oct 2014 at 5:35

GoogleCodeExporter commented 9 years ago
fclose() must be called before return statement only in case that file is open. 
And it is done in ParamUtils::ReadParamsFile[1].

https://code.google.com/p/tesseract-ocr/source/browse/ccutil/params.cpp?r=36b55f
7710cf0dc7d9d41c052fbd3b84d38e5467#41

Original comment by zde...@gmail.com on 7 Feb 2015 at 8:58