[Common] condition to release extra info
authorJaeyun Jung <jy1210.jung@samsung.com>
Fri, 19 May 2023 05:15:18 +0000 (14:15 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 22 May 2023 02:06:59 +0000 (11:06 +0900)
Remove unnecessary log-print, most pipelines does not have extra info and dont need releasing extra info.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
gst/nnstreamer/nnstreamer_plugin_api_util_impl.c

index 614fc70..3cd1e41 100644 (file)
@@ -368,14 +368,14 @@ gst_tensors_info_extra_free (GstTensorsInfo * info)
   guint i;
 
   g_return_if_fail (info != NULL);
-  g_return_if_fail (info->extra != NULL);
 
-  for (i = 0; i < NNS_TENSOR_SIZE_EXTRA_LIMIT; ++i) {
-    gst_tensor_info_free (&info->extra[i]);
-  }
+  if (info->extra) {
+    for (i = 0; i < NNS_TENSOR_SIZE_EXTRA_LIMIT; ++i)
+      gst_tensor_info_free (&info->extra[i]);
 
-  g_free (info->extra);
-  info->extra = NULL;
+    g_free (info->extra);
+    info->extra = NULL;
+  }
 }
 
 /**