From: min7.choi Date: Fri, 16 Dec 2016 08:19:29 +0000 (+0900) Subject: Fix resource leak for pthread_cancel() X-Git-Tag: accepted/tizen/3.0.m2/mobile/20170105.023852^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4ffec953b24a55d34d45c63f672d1c36b5b38e80;p=platform%2Fframework%2Fweb%2Fdownload-provider.git Fix resource leak for pthread_cancel() Change-Id: I6563d045f9ff64d16e3ffc4762f4379fa62a48fc Signed-off-by: min7.choi --- diff --git a/agent/download-agent-http-mgr.c b/agent/download-agent-http-mgr.c index 7e84a96..3bdd318 100755 --- a/agent/download-agent-http-mgr.c +++ b/agent/download-agent-http-mgr.c @@ -641,6 +641,8 @@ da_ret_t request_to_cancel_http_download(da_info_t *da_info) da_ret_t ret = DA_RESULT_OK; http_info_t *http_info = DA_NULL; http_state_t http_state = 0; + int status; + DA_LOGV(""); NULL_CHECK_RET(da_info); @@ -661,6 +663,7 @@ da_ret_t request_to_cancel_http_download(da_info_t *da_info) if (pthread_cancel(da_info->thread_id) != 0) { DA_LOGE("Fail to cancel thread id[%d]", da_info->thread_id); + pthread_join(da_info->thread_id, (void **)&status); } else { DA_LOGI("====Exit thread with cancel:da_id[%d]===", da_info->da_id); diff --git a/packaging/download-provider.spec b/packaging/download-provider.spec index 9bbe499..417237b 100755 --- a/packaging/download-provider.spec +++ b/packaging/download-provider.spec @@ -1,7 +1,7 @@ %define _ux_define tizen2.3 Name: download-provider Summary: Download the contents in background -Version: 2.1.69 +Version: 2.1.70 Release: 0 Group: Development/Libraries License: Apache-2.0