[C-Api] free element handle accepted/tizen/unified/20190717.115101 submit/tizen/20190717.061257
authorJaeyun <jy1210.jung@samsung.com>
Mon, 15 Jul 2019 04:58:50 +0000 (13:58 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 15 Jul 2019 15:36:48 +0000 (00:36 +0900)
Add code to free pipeline element and hash-table.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
api/capi/src/nnstreamer-capi-pipeline.c
tests/tizen_capi/unittest_tizen_capi.cpp

index ba29d9d..dd8621c 100644 (file)
@@ -327,6 +327,8 @@ cleanup_node (gpointer data)
 
   g_mutex_unlock (&e->lock);
   g_mutex_clear (&e->lock);
+
+  g_free (e);
 }
 
 /**
@@ -510,7 +512,7 @@ ml_pipeline_destroy (ml_pipeline_h pipe)
   gst_object_unref (p->bus);
 
   /** Destroy registered callback handles */
-  g_hash_table_remove_all (p->namednodes);
+  g_hash_table_destroy (p->namednodes);
 
   /** Stop (NULL State) the pipeline */
   scret = gst_element_set_state (p->element, GST_STATE_NULL);
index b7da64e..34fae6a 100644 (file)
@@ -801,6 +801,7 @@ TEST (nnstreamer_capi_src, failure_03)
   EXPECT_EQ (status, ML_ERROR_NONE);
 
   status = ml_tensors_data_create (info, &data);
+  EXPECT_EQ (status, ML_ERROR_NONE);
 
   /* null data */
   status = ml_pipeline_src_input_data (srchandle, NULL, ML_PIPELINE_BUF_POLICY_DO_NOT_FREE);