From: Jaeyun Date: Mon, 15 Jul 2019 04:58:50 +0000 (+0900) Subject: [C-Api] free element handle X-Git-Tag: accepted/tizen/unified/20190717.115101^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=303181fd867f739e6f363abbf4310f9a0ceaa2f7;p=platform%2Fupstream%2Fnnstreamer.git [C-Api] free element handle Add code to free pipeline element and hash-table. Signed-off-by: Jaeyun Jung --- diff --git a/api/capi/src/nnstreamer-capi-pipeline.c b/api/capi/src/nnstreamer-capi-pipeline.c index ba29d9d..dd8621c 100644 --- a/api/capi/src/nnstreamer-capi-pipeline.c +++ b/api/capi/src/nnstreamer-capi-pipeline.c @@ -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); diff --git a/tests/tizen_capi/unittest_tizen_capi.cpp b/tests/tizen_capi/unittest_tizen_capi.cpp index b7da64e..34fae6a 100644 --- a/tests/tizen_capi/unittest_tizen_capi.cpp +++ b/tests/tizen_capi/unittest_tizen_capi.cpp @@ -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);