From bb523d4c0148e777a77a0e936bf457fd7e65ced1 Mon Sep 17 00:00:00 2001 From: Yongjoo Ahn Date: Thu, 8 Feb 2024 16:19:47 +0900 Subject: [PATCH] [test] Fix mem leak in tflite unittest - Fix memory leak by unref Signed-off-by: Yongjoo Ahn --- .../unittest_filter_tensorflow2_lite.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/nnstreamer_filter_tensorflow2_lite/unittest_filter_tensorflow2_lite.cc b/tests/nnstreamer_filter_tensorflow2_lite/unittest_filter_tensorflow2_lite.cc index e0ca04a..1172cf5 100644 --- a/tests/nnstreamer_filter_tensorflow2_lite/unittest_filter_tensorflow2_lite.cc +++ b/tests/nnstreamer_filter_tensorflow2_lite/unittest_filter_tensorflow2_lite.cc @@ -110,6 +110,9 @@ check_output (GstElement *element, GstBuffer *buffer, gpointer user_data) } EXPECT_EQ (max_idx, 951U); + + gst_memory_unmap (mem_res, &info_res); + gst_memory_unref (mem_res); } /** @@ -194,6 +197,7 @@ TEST (nnstreamerFilterTensorFlow2Lite, quantModelResult) EXPECT_EQ (setPipelineStateSync (gstpipe, GST_STATE_NULL, UNITTEST_STATECHANGE_TIMEOUT), 0); + gst_object_unref (sink_handle); gst_object_unref (gstpipe); g_free (pipeline); g_free (model_file); -- 2.7.4