[Queue] clear data when releasing the queue accepted/tizen/unified/20230118.172041
authorJaeyun <jy1210.jung@samsung.com>
Thu, 12 Jan 2023 16:17:04 +0000 (01:17 +0900)
committerSangjung Woo <again4you@gmail.com>
Wed, 18 Jan 2023 05:07:54 +0000 (14:07 +0900)
Code clean, remove duplicated code to clear data.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
src/libnnstreamer-edge/nnstreamer-edge-queue.c

index 8f978e3c7dd6c96c3dc4771f59c2b67edbd673d9..2d1bc5091bc64735bd16a78684c8c697743be921 100644 (file)
@@ -116,13 +116,8 @@ nns_edge_queue_destroy (nns_edge_queue_h handle)
     return false;
   }
 
-  nns_edge_lock (q);
-  nns_edge_cond_signal (q);
-
-  while (q->length > 0U)
-    _pop_data (q, true, NULL, NULL);
-
-  nns_edge_unlock (q);
+  /* Stop waiting and clear all data. */
+  nns_edge_queue_clear (handle);
 
   nns_edge_cond_destroy (q);
   nns_edge_lock_destroy (q);