From 372e838e10a83356e7431bfb7e2bbbd5061ca8a0 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Wed, 2 Aug 2017 18:56:50 +0900 Subject: [PATCH] Fixed the crash issue when the ecore_wl_shutdown() is called without init Change-Id: I334bdc1144b00a765a3c59ac7b3669f6548228a0 --- ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp b/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp index 519654c..f95e8cb 100644 --- a/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp +++ b/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp @@ -211,6 +211,7 @@ static bool read_devices = false; static bool _need_wl_im_init = false; static struct _wl_im *_wl_im_ctx = NULL; +static int _ecore_wl_init_count = 0; #define WAYLAND_MODULE_CLIENT_ID (0) #define MAX_PREEDIT_BUFSIZE 4000 @@ -1169,7 +1170,7 @@ isf_wsc_context_init (void) LOGD (""); if (!_scim_initialized) { - ecore_wl_init (NULL); + _ecore_wl_init_count = ecore_wl_init (NULL); initialize (); _scim_initialized = true; isf_wsc_input_panel_init (); @@ -1188,7 +1189,11 @@ isf_wsc_context_shutdown (void) isf_wsc_input_panel_shutdown (); finalize (); - ecore_wl_shutdown (); + + if (_ecore_wl_init_count > 0) { + ecore_wl_shutdown (); + _ecore_wl_init_count = 0; + } } } -- 2.7.4