modality_vision : set NULL when destroy and shutdown 38/265238/1
authordyamy-lee <dyamy.lee@samsung.com>
Wed, 13 Oct 2021 04:54:03 +0000 (13:54 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Wed, 13 Oct 2021 06:39:24 +0000 (15:39 +0900)
Change-Id: I99981feea71ecfca9fcc2da720a3c7d480c377ef

src/modules/modality_vision/vision.c

index ec93f33..be78737 100644 (file)
@@ -236,6 +236,7 @@ void _vision_finish_cb(void *user_data)
                if (MEDIA_VISION_ERROR_NONE != err) {
                        LOGE("ERROR: Errors were occurred during video reader destroying; code %i\n", err);
                }
+               reader = NULL;
        }
 
        LOGD("end of destroy");
@@ -298,6 +299,7 @@ void new_frame_cb(
                                        "code %i\n", \
                                        err2); \
                } \
+               frame = NULL; \
        }
 
        int err = mv_create_source(&frame);
@@ -349,6 +351,7 @@ int infer_task_with_video(const char *path_to_video, mv_inference_h infer, int t
                if (MEDIA_VISION_ERROR_NONE != err2) { \
                        LOGE("ERROR: Errors were occurred during video reader destroying; code %i\n", err2); \
                } \
+               reader = NULL; \
        }
 
        err = mv_create_video_reader(&reader);
@@ -571,6 +574,8 @@ int vision_shutdown(void)
        }
        ecore_event_handler_del(_event_handlers);
        _event_handlers = NULL;
+       _engine_cfg = NULL;
+       _infer = NULL;
        LOGD("end of shutdown");
        return err;
 }