aboutsummaryrefslogtreecommitdiff
path: root/cpp/libchelleport.cpp
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2024-12-28 21:49:02 +0530
committerAkshay Nair <phenax5@gmail.com>2024-12-28 21:57:01 +0530
commit9b5c8368daa97a5b58a378d9c4eab66ebb018cb0 (patch)
tree9faec7fbb2da551e02c819cabfedf670b6fc854a /cpp/libchelleport.cpp
parentd000cbb52821dc33c5d2f3d676dc6efa54f3b25f (diff)
downloadchelleport-9b5c8368daa97a5b58a378d9c4eab66ebb018cb0.tar.gz
chelleport-9b5c8368daa97a5b58a378d9c4eab66ebb018cb0.zip
Fix memory leak issue with c++ interop
Diffstat (limited to 'cpp/libchelleport.cpp')
-rw-r--r--cpp/libchelleport.cpp2
1 files changed, 1 insertions, 1 deletions
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();