[v0.6.14] fix fd leak 08/98108/1
authorEunhae Choi <eunhae1.choi@samsung.com>
Wed, 16 Nov 2016 07:16:31 +0000 (16:16 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Wed, 16 Nov 2016 07:16:31 +0000 (16:16 +0900)
Change-Id: Ida0fc16e9fd8cb31d8bd513037ec83856be7b0df

packaging/libmm-player.spec
src/mm_player_resource.c

index c38c4ed..72bd49d 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.13
+Version:    0.6.14
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 7c7e879..5474c0e 100644 (file)
@@ -296,8 +296,8 @@ static int set_resource_release_cb(MMPlayerResourceManager *resource_manager)
 
 static gpointer __mmplayer_launch_glib_murphy_loop(void *user_data)
 {
-       LOGI("Run mrp_loop");
        MMPlayerResourceManager *resource_manager= (MMPlayerResourceManager *)user_data;
+       LOGI("Run mrp_loop");
        g_main_loop_run(resource_manager->mrp_loop);
        LOGI("Murphy glib loop exit");
        return NULL;
@@ -484,15 +484,21 @@ int _mmplayer_resource_manager_deinit(MMPlayerResourceManager *resource_manager)
                mrp_res_delete_resource_set(resource_manager->rset);
                resource_manager->rset = NULL;
        }
+
        if (resource_manager->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) {
                mrp_mainloop_destroy(resource_manager->mloop);