mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 20:59:36 +08:00
Fix memory leak in loadlang_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
74f6d0e7ff
commit
5209aa6c95
@ -16,6 +16,7 @@
|
||||
// limitations under the License.
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <memory> // std::unique_ptr
|
||||
#include <time.h>
|
||||
#include "baseapi.h"
|
||||
#include "include_gunit.h"
|
||||
@ -35,7 +36,7 @@ class QuickTest : public testing::Test {
|
||||
};
|
||||
|
||||
void LangLoader(const char* lang, const char* tessdatadir) {
|
||||
tesseract::TessBaseAPI* api = new tesseract::TessBaseAPI();
|
||||
std::unique_ptr<tesseract::TessBaseAPI> api(new tesseract::TessBaseAPI());
|
||||
ASSERT_FALSE(api->Init(tessdatadir, lang))
|
||||
<< "Could not initialize tesseract for $lang.";
|
||||
api->End();
|
||||
|
Loading…
Reference in New Issue
Block a user