From 9b5c8368daa97a5b58a378d9c4eab66ebb018cb0 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sat, 28 Dec 2024 21:49:02 +0530 Subject: Fix memory leak issue with c++ interop --- cpp/libchelleport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cpp/libchelleport.cpp') diff --git a/cpp/libchelleport.cpp b/cpp/libchelleport.cpp index 53ba64e..010fdd4 100644 --- a/cpp/libchelleport.cpp +++ b/cpp/libchelleport.cpp @@ -13,7 +13,7 @@ extern "C" OCRMatch *findWordCoordinates(const char *image_path, int *size) { OCRMatchSet matches; MEASURE("OCR", { matches = extractTextMatches(image_path); }); - static OCRMatch *ptr = new OCRMatch[matches.size()]; + OCRMatch *ptr = new OCRMatch[matches.size()]; std::copy(matches.begin(), matches.end(), ptr); *size = matches.size(); -- cgit v1.3.1