From 5dc4af62fb966b072aa12494c89a7df8e0d36042 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 13 May 2017 12:14:29 +0200 Subject: [PATCH] baseapi: Simplify code Signed-off-by: Stefan Weil --- api/baseapi.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/api/baseapi.cpp b/api/baseapi.cpp index 2117e791..883061f0 100644 --- a/api/baseapi.cpp +++ b/api/baseapi.cpp @@ -2064,12 +2064,10 @@ void TessBaseAPI::End() { delete paragraph_models_; paragraph_models_ = NULL; } - if (tesseract_ != NULL) { - delete tesseract_; - if (osd_tesseract_ == tesseract_) - osd_tesseract_ = NULL; - tesseract_ = NULL; - } + if (osd_tesseract_ == tesseract_) + osd_tesseract_ = nullptr; + delete tesseract_; + tesseract_ = nullptr; delete osd_tesseract_; osd_tesseract_ = NULL; delete equ_detect_;