[Example] change free function
authorJaeyun <jy1210.jung@samsung.com>
Thu, 15 Nov 2018 10:12:05 +0000 (19:12 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Sat, 17 Nov 2018 05:37:17 +0000 (14:37 +0900)
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 <jy1210.jung@samsung.com>
nnstreamer_example/example_filter/nnstreamer_example_filter.c
nnstreamer_example/example_object_detection/nnstreamer_example_object_detection.cc

index c71988a..ab82981 100644 (file)
@@ -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;
   }
 }
index 6b785e9..a569989 100644 (file)
@@ -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;
   }
 }