Commit 7fd90498 for tesseract

commit 7fd90498ca8b9694d1b4175a68363533b073154d
Author: Stefan Weil <sw@weilnetz.de>
Date:   Fri Apr 2 22:40:37 2021 +0200

    Modernize code

    Signed-off-by: Stefan Weil <sw@weilnetz.de>

diff --git a/src/api/renderer.cpp b/src/api/renderer.cpp
index dccc7b86..aa7dd09e 100644
--- a/src/api/renderer.cpp
+++ b/src/api/renderer.cpp
@@ -226,13 +226,12 @@ bool TessBoxTextRenderer::AddImageHandler(TessBaseAPI *api) {
 TessOsdRenderer::TessOsdRenderer(const char *outputbase) : TessResultRenderer(outputbase, "osd") {}

 bool TessOsdRenderer::AddImageHandler(TessBaseAPI *api) {
-  char *osd = api->GetOsdText(imagenum());
+  const std::unique_ptr<const char[]> osd(api->GetOsdText(imagenum()));
   if (osd == nullptr) {
     return false;
   }

-  AppendString(osd);
-  delete[] osd;
+  AppendString(osd.get());

   return true;
 }