Skip to content

Commit

Permalink
Fix memory leak in osd_test
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Nov 13, 2018
1 parent 5209aa6 commit ff5347c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion unittest/osd_test.cc
Expand Up @@ -20,6 +20,7 @@

//#include "log.h"
#include <iostream>
#include <memory> // std::unique_ptr
#include <string>
#include "baseapi.h"
#include "include_gunit.h"
Expand All @@ -33,7 +34,7 @@ class TestClass : public testing::Test {

void OSDTester(int expected_deg, const char* imgname, const char* tessdatadir) {
// log.info() << tessdatadir << " for image: " << imgname << std::endl;
tesseract::TessBaseAPI* api = new tesseract::TessBaseAPI();
std::unique_ptr<tesseract::TessBaseAPI> api(new tesseract::TessBaseAPI());
ASSERT_FALSE(api->Init(tessdatadir, "osd"))
<< "Could not initialize tesseract.";
Pix* image = pixRead(imgname);
Expand Down

0 comments on commit ff5347c

Please sign in to comment.