Avoid duplicate termination 00/247400/5
authorInHong Han <inhong1.han@samsung.com>
Tue, 10 Nov 2020 10:33:07 +0000 (19:33 +0900)
committerInHong Han <inhong1.han@samsung.com>
Wed, 11 Nov 2020 04:49:09 +0000 (13:49 +0900)
ime_terminate_cb was called several times so IME did not terminate normally

Change-Id: I839d462e7d69c8caaa03b0b408464444d2d614df

src/sclconnection-isf.cpp
src/sclcoreimpl.cpp

index 05fecf2..d7af7c3 100644 (file)
@@ -28,6 +28,7 @@ extern CWebHelperAgentWebSocket g_websocket;
 using namespace scl;
 
 static scim::ConfigPointer _scim_config(0);
+extern sclboolean g_need_exit;
 
 /* Slot functions for calling appropriate callback functions */
 static void slot_exit(const scim::HelperAgent *agent, int ic, const scim::String &ic_uuid) {
@@ -38,6 +39,7 @@ static void slot_exit(const scim::HelperAgent *agent, int ic, const scim::String
             callback->on_ise_hide(ic, ic_uuid.c_str());
             LOGD("call on_exit");
             callback->on_exit();
+            g_need_exit = FALSE:
         }
         if (agent) {
             agent->update_ise_exit();
@@ -920,6 +922,7 @@ void CSCLConnectionISF::open_connection(const sclchar *display)
 #endif
 
             m_fd_handler = ecore_main_fd_handler_add(fd, ECORE_FD_READ, input_handler, &m_helper_agent, NULL, NULL);
+            g_need_exit = TRUE;
         }
     }
 }
index 699af8d..6c79337 100644 (file)
@@ -21,6 +21,8 @@
 
 using namespace scl;
 
+sclboolean g_need_exit = TRUE;
+
 CSCLCoreImpl::CSCLCoreImpl()
 {
     m_event_callback = NULL;
@@ -98,7 +100,7 @@ sclboolean CSCLCoreImpl::prepare()
 void CSCLCoreImpl::fini()
 {
     LOGD("");
-    if (m_event_callback) {
+    if (m_event_callback && g_need_exit) {
         m_event_callback->on_exit();
     }