From: Jeongmo Yang Date: Wed, 16 Nov 2016 05:33:42 +0000 (+0900) Subject: Fix fd leak X-Git-Tag: accepted/tizen/common/20161117.085411^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bc80ca3d7c71f7e3496379e9fc4d724d0fe469a0;p=platform%2Fcore%2Fmultimedia%2Flibmm-camcorder.git Fix fd leak Missed g_main_loop_unref for murphy's context [Version] 0.10.93 [Profile] Common [Issue Type] [Dependency module] N/A [Test] [M(T) - Boot=(OK), sdb=(OK), Home=(OK), Touch=(OK), Version=tizen-3.0-mobile_20161115.1] Change-Id: I452e88c259e2833a96e567f285c26a63e0176403 Signed-off-by: Jeongmo Yang --- diff --git a/packaging/libmm-camcorder.spec b/packaging/libmm-camcorder.spec index 7918607..b03d0ad 100644 --- a/packaging/libmm-camcorder.spec +++ b/packaging/libmm-camcorder.spec @@ -1,6 +1,6 @@ Name: libmm-camcorder Summary: Camera and recorder library -Version: 0.10.92 +Version: 0.10.93 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/mm_camcorder_resource.c b/src/mm_camcorder_resource.c index af32408..e09afb5 100644 --- a/src/mm_camcorder_resource.c +++ b/src/mm_camcorder_resource.c @@ -320,10 +320,14 @@ static int __mmcamcorder_resource_set_release_cb(MMCamcorderResourceManager *res static gpointer __mmcamcorder_launch_glib_murphy_loop(void *user_data) { - LOGI("Run mrp_loop"); MMCamcorderResourceManager *resource_manager= (MMCamcorderResourceManager *)user_data; + + _mmcam_dbg_log("Run mrp_loop"); + g_main_loop_run(resource_manager->mrp_loop); - LOGI("Murphy glib loop exit"); + + _mmcam_dbg_log("Murphy glib loop exit"); + return NULL; } @@ -433,16 +437,23 @@ int _mmcamcorder_resource_manager_deinit(MMCamcorderResourceManager *resource_ma mrp_res_delete_resource_set(resource_manager->rset); resource_manager->rset = NULL; } + if (resource_manager->context) { _mmcam_dbg_log("destroy resource context"); mrp_res_destroy(resource_manager->context); resource_manager->context = NULL; } + if (resource_manager->mrp_loop) { g_main_loop_quit(resource_manager->mrp_loop); + g_main_loop_unref(resource_manager->mrp_loop); resource_manager->mrp_loop = NULL; } + g_thread_join(resource_manager->starter); + g_thread_unref(resource_manager->starter); + resource_manager->starter = NULL; + if (resource_manager->mloop) { _mmcam_dbg_log("destroy resource mainloop"); mrp_mainloop_destroy(resource_manager->mloop);