From 3894eb2cf8e66b3f80f68a952ea00a60622bebea Mon Sep 17 00:00:00 2001 From: Jaeyun Date: Thu, 15 Nov 2018 19:12:05 +0900 Subject: [PATCH] [Example] change free function change function to free list (elements in the list contain the dynamic-allocated memory, we should free all these elements) Signed-off-by: Jaeyun Jung --- nnstreamer_example/example_filter/nnstreamer_example_filter.c | 2 +- .../example_object_detection/nnstreamer_example_object_detection.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nnstreamer_example/example_filter/nnstreamer_example_filter.c b/nnstreamer_example/example_filter/nnstreamer_example_filter.c index c71988a..ab82981 100644 --- a/nnstreamer_example/example_filter/nnstreamer_example_filter.c +++ b/nnstreamer_example/example_filter/nnstreamer_example_filter.c @@ -108,7 +108,7 @@ _tflite_free_info (tflite_info_s * tflite_info) } if (tflite_info->labels) { - g_list_free (tflite_info->labels); + g_list_free_full (tflite_info->labels, g_free); tflite_info->labels = NULL; } } diff --git a/nnstreamer_example/example_object_detection/nnstreamer_example_object_detection.cc b/nnstreamer_example/example_object_detection/nnstreamer_example_object_detection.cc index 6b785e9..a569989 100644 --- a/nnstreamer_example/example_object_detection/nnstreamer_example_object_detection.cc +++ b/nnstreamer_example/example_object_detection/nnstreamer_example_object_detection.cc @@ -181,7 +181,7 @@ tflite_load_box_priors (TFLiteModelInfo * tflite_info) tflite_info->box_priors[row][column++] = atof (buff); } - g_list_free (box_priors); + g_list_free_full (box_priors, g_free); return TRUE; } @@ -245,7 +245,7 @@ tflite_free_info (TFLiteModelInfo * tflite_info) } if (tflite_info->labels) { - g_list_free (tflite_info->labels); + g_list_free_full (tflite_info->labels, g_free); tflite_info->labels = NULL; } } -- 2.7.4