diff options
author | Tae-Young Chung <ty83.chung@samsung.com> | 2016-05-24 14:16:35 +0900 |
---|---|---|
committer | Tae-Young Chung <ty83.chung@samsung.com> | 2016-06-09 18:59:06 +0900 |
commit | ba38da18f6d5eb7ede4cd0a135c3b5b5d6681def (patch) | |
tree | 70f8288ba2c2424013ff2ac9d74ec26a83097661 | |
parent | 31817a245cf354b7bb9c7a38abd55227f3e4e463 (diff) | |
download | mediavision-ba38da18f6d5eb7ede4cd0a135c3b5b5d6681def.tar.gz mediavision-ba38da18f6d5eb7ede4cd0a135c3b5b5d6681def.tar.bz2 mediavision-ba38da18f6d5eb7ede4cd0a135c3b5b5d6681def.zip |
Fixed latent memory leak issuesubmit/tizen/20160610.024249accepted/tizen/wearable/20160610.114138accepted/tizen/tv/20160610.114107accepted/tizen/mobile/20160610.114052accepted/tizen/ivi/20160610.114149accepted/tizen/common/20160610.182446
Change-Id: Icb565007c63f9e2b9d8d2b5ce281a3476973ea43
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
-rw-r--r-- | mv_face/face/src/mv_face_open.cpp | 15 | ||||
-rw-r--r-- | mv_image/image/src/Tracking/AsyncTracker.cpp | 4 | ||||
-rw-r--r-- | packaging/capi-media-vision.spec | 4 | ||||
-rw-r--r-- | test/testsuites/face/face_test_suite.c | 3 |
4 files changed, 17 insertions, 9 deletions
diff --git a/mv_face/face/src/mv_face_open.cpp b/mv_face/face/src/mv_face_open.cpp index 917924e2..07e07dfa 100644 --- a/mv_face/face/src/mv_face_open.cpp +++ b/mv_face/face/src/mv_face_open.cpp @@ -726,13 +726,16 @@ int mv_face_recognition_model_query_labels_open( const std::set<int>& learnedLabels = pRecModel->getFaceLabels(); *number_of_labels = learnedLabels.size(); - (*labels) = (int*)malloc(sizeof(int) * (*number_of_labels)); - std::set<int>::const_iterator it = learnedLabels.begin(); - int i = 0; - for (; it != learnedLabels.end(); ++it) { - (*labels)[i] = *it; - ++i; + if ((*number_of_labels)) { + (*labels) = (int*)malloc(sizeof(int) * (*number_of_labels)); + + std::set<int>::const_iterator it = learnedLabels.begin(); + int i = 0; + for (; it != learnedLabels.end(); ++it) { + (*labels)[i] = *it; + ++i; + } } LOGD("List of the labels learned by the recognition model has been retrieved"); diff --git a/mv_image/image/src/Tracking/AsyncTracker.cpp b/mv_image/image/src/Tracking/AsyncTracker.cpp index 5ae18ae9..389fc4be 100644 --- a/mv_image/image/src/Tracking/AsyncTracker.cpp +++ b/mv_image/image/src/Tracking/AsyncTracker.cpp @@ -78,8 +78,10 @@ bool AsyncTracker::track( const int err = pthread_create(&m_thread, NULL, asyncTrack, this); - if (0 == err) + if (0 == err) { + pthread_join(m_thread, NULL); return getResult(result); + } pthread_spin_lock(&m_isRunGuard); m_isRun = false; diff --git a/packaging/capi-media-vision.spec b/packaging/capi-media-vision.spec index c9c241a7..12729c88 100644 --- a/packaging/capi-media-vision.spec +++ b/packaging/capi-media-vision.spec @@ -1,7 +1,7 @@ Name: capi-media-vision Summary: Media Vision library for Tizen Native API -Version: 0.3.17 -Release: 1 +Version: 0.3.18 +Release: 0 Group: Multimedia/Framework License: Apache-2.0 and BSD-2.0 Source0: %{name}-%{version}.tar.gz diff --git a/test/testsuites/face/face_test_suite.c b/test/testsuites/face/face_test_suite.c index aceb9d00..5cfd431b 100644 --- a/test/testsuites/face/face_test_suite.c +++ b/test/testsuites/face/face_test_suite.c @@ -1358,6 +1358,7 @@ int perform_mv_face_tracking_model_prepare(mv_face_tracking_model_h model) err = load_mv_source_from_file(init_frame_file_name, preparation_frame); free(init_frame_file_name); + init_frame_file_name = NULL; if (MEDIA_VISION_ERROR_NONE != err) { printf(TEXT_RED "ERROR: Errors were occurred during preparation " @@ -1451,6 +1452,8 @@ int perform_mv_face_tracking_model_prepare(mv_face_tracking_model_h model) "source! Error code: %i\n" TEXT_RESET, err2); } + mv_destroy_engine_config(eng_config); + eng_config = NULL; return err; } |