From 08dd1d9515c1b5b7d3e5b00865c88fcda18becc2 Mon Sep 17 00:00:00 2001 From: Tae-Young Chung Date: Thu, 30 Jun 2016 15:35:27 +0900 Subject: [PATCH] [UTC][capi-media-vision][Non-ACR][Fixed memory leak] [cause] - The created handles are not destroyed - The loaded resouces (images) are not unloaded [solve] - Destroy handles and unload resources Change-Id: I09dc318e0e863ee81179409ab226e656a001b2ec Signed-off-by: Tae-Young Chung --- src/utc/capi-media-vision/utc-mv_face.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/utc/capi-media-vision/utc-mv_face.c b/src/utc/capi-media-vision/utc-mv_face.c index 1bf08c8..9118886 100755 --- a/src/utc/capi-media-vision/utc-mv_face.c +++ b/src/utc/capi-media-vision/utc-mv_face.c @@ -336,7 +336,7 @@ void utc_capi_media_vision_face_cleanup(void) tracking_model = NULL; } - if (pInternalStoragePath) { + if (pInternalStoragePath) { free(pInternalStoragePath); pInternalStoragePath = NULL; } @@ -953,6 +953,10 @@ int utc_mediavision_mv_face_track_n(void) ret = mv_face_track(source, tracking_model, NULL, NULL, true, NULL); assert_eq(MEDIA_VISION_ERROR_INVALID_PARAMETER, ret); + ret = mv_destroy_source(source); + source = NULL; + assert_eq(MEDIA_VISION_ERROR_NONE, ret); + printf("Before return mv_face_track_n\n"); return 0; @@ -1702,6 +1706,7 @@ int utc_mediavision_mv_face_recognition_model_clone_p(void) ret = mv_face_recognition_model_destroy(dest_model); assert_eq(MEDIA_VISION_ERROR_NONE, ret); + assert_eq(MEDIA_VISION_ERROR_NONE, free_face_examples()); printf("Before return mv_face_recognition_model_clone_p\n"); return 0; @@ -2043,6 +2048,14 @@ int utc_mediavision_mv_face_recognition_model_add_n(void) ret = mv_face_recognition_model_add(source, recognition_model, &bad_roi3, 0); assert_eq(MEDIA_VISION_ERROR_INVALID_PARAMETER, ret); + ret = mv_destroy_source(source); + source = NULL; + assert_eq(MEDIA_VISION_ERROR_NONE, ret); + + ret = mv_face_recognition_model_destroy(recognition_model); + recognition_model = NULL; + assert_eq(MEDIA_VISION_ERROR_NONE, ret); + printf("Before return mv_face_recognition_model_add_n\n"); return 0; -- 2.7.4