[Filter/Example] apply destroyNotify() callback at example
authorHyoung Joo Ahn <hello.ahnn@gmail.com>
Fri, 18 Jan 2019 03:33:31 +0000 (12:33 +0900)
committerMyungJoo Ham <myungjoo.ham@gmail.com>
Sun, 20 Jan 2019 10:07:14 +0000 (19:07 +0900)
add destroy_notify callback at the example using allocate_invoke.

Signed-off-by: Hyoung Joo Ahn <hello.ahnn@gmail.com>
nnstreamer_example/custom_example_opencv/nnstreamer_customfilter_opencv_scaler.cc

index 98000cc..1d1485c 100644 (file)
@@ -172,6 +172,16 @@ pt_allocate_invoke (void *private_data,
 }
 
 /**
+ * @brief destroy notify callback of tensor_filter custom
+ */
+static void
+pt_destroy_notify (void * data)
+{
+  g_assert (data);
+  g_free (data);
+}
+
+/**
  * @brief tensor_filter custom subplugin definition
  */
 static NNStreamer_custom_class NNStreamer_custom_body = {
@@ -182,6 +192,7 @@ static NNStreamer_custom_class NNStreamer_custom_body = {
   .setInputDim = set_inputDim,
   .invoke = NULL,
   .allocate_invoke = pt_allocate_invoke,
+  .destroy_notify = pt_destroy_notify,
 };
 
 /* The dyn-loaded object */