[Filter/Mediapipe] fix a bug at destructor
authorHyoung Joo Ahn <hello.ahn@samsung.com>
Mon, 18 May 2020 03:03:23 +0000 (12:03 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 20 May 2020 00:28:40 +0000 (09:28 +0900)
call free the resource after using it.

Signed-off-by: Hyoung Joo Ahn <hello.ahn@samsung.com>
ext/nnstreamer/tensor_filter/tensor_filter_mediapipe.cc

index 5b0c219..bdab84e 100644 (file)
@@ -106,15 +106,16 @@ mediapipe_subplugin::~mediapipe_subplugin ()
 
   g_free (config_path);
 
-  gst_tensors_info_free (&inputInfo);
-  gst_tensors_info_free (&outputInfo);
-
   for (unsigned int i = 0; i < inputInfo.num_tensors; i++) {
     status = graph.CloseInputStream (inputInfo.info[i].name);
     if (!status.ok ()) {
       std::cerr << "Failed to close input stream" << std::endl;
     }
   }
+
+  gst_tensors_info_free (&inputInfo);
+  gst_tensors_info_free (&outputInfo);
+
   status = graph.WaitUntilDone ();
   if (!status.ok ()) {
     std::cerr << "Failed to closing mediapipe graph" << std::endl;