From 9cc407ba4339335f1dd452e84281d5b63b372da6 Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Fri, 17 Jan 2020 16:17:40 +0900 Subject: [PATCH] Unregister fd event handler for vc_config.xml Change-Id: Ie92239f2c535100ac8c32ff21849c224735289c4 --- common/vc_config_mgr.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/vc_config_mgr.c b/common/vc_config_mgr.c index ca4895e..44ea696 100644 --- a/common/vc_config_mgr.c +++ b/common/vc_config_mgr.c @@ -69,6 +69,7 @@ static int g_wd_lang; static GList* g_ino_list = NULL; static pthread_mutex_t vc_config_mgr_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t vc_config_engine_mutex = PTHREAD_MUTEX_INITIALIZER; static int __vc_config_mgr_register_engine_config_updated_event(const char* path); static int __vc_config_mgr_unregister_engine_config_updated_event(); @@ -534,13 +535,17 @@ static int __vc_config_mgr_register_engine_config_updated_event(const char* path SLOG(LOG_WARN, vc_config_tag(), "[WARNING] Fail to set non-block mode"); } + pthread_mutex_lock(&vc_config_mgr_mutex); g_ino_list = g_list_append(g_ino_list, ino); + pthread_mutex_unlock(&vc_config_mgr_mutex); return 0; } static int __vc_config_mgr_unregister_engine_config_updated_event() { + pthread_mutex_lock(&vc_config_mgr_mutex); + /* delete all inotify variable */ if (0 < g_list_length(g_ino_list)) { GList *iter = NULL; @@ -563,7 +568,7 @@ static int __vc_config_mgr_unregister_engine_config_updated_event() iter = g_list_first(g_ino_list); } } - + pthread_mutex_unlock(&vc_config_mgr_mutex); return 0; } @@ -1049,6 +1054,8 @@ int vc_config_mgr_finalize(int uid) __vc_config_release_engine(); + __vc_config_mgr_unregister_engine_config_updated_event(); + vconf_ignore_key_changed(VCONFKEY_LANGSET, __vc_config_language_changed_cb); vc_parser_unload_config(g_config_info); -- 2.7.4