Remove IME from the client repository when sending EXIT command 38/147838/2
authorJi-hoon Lee <dalton.lee@samsung.com>
Tue, 29 Aug 2017 06:43:15 +0000 (15:43 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Wed, 6 Sep 2017 01:52:43 +0000 (10:52 +0900)
Even after sending EXIT command to the currently selected IME,
the IME may not get destroyed right away due to its termination
logic, meaning the client repository still holds the IME info
until the socket connection is completely closed.
This would cause an unexpected result if the user first selects
IME A and then IME B, and IME A again.
After the last "IME A selected" event, if the socket connection to
previous IME A gets closed, panel would think the current IME
(that was launched due to the last selection for IME A) needs to be
restarted, so it tries launching new IME A instance.
To prevent this, we will going to remove IME info from client
repository right after we send the EXIT request command.

Change-Id: I28cdcf7796028d59cc6929c182abd64868309053

ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp
ism/src/isf_info_manager.cpp

index b334374..084b398 100644 (file)
@@ -1028,6 +1028,8 @@ private:
 
         Socket client_socket(client);
         m_send_trans.write_to_socket(client_socket);
+
+        m_info_manager->del_client(client_socket.get_id());
     }
 
     bool process_input_device_event(int client, uint32 context, const String& uuid, uint32 type, const char *data, size_t len, _OUT_ uint32& result) {
index 6f26f67..01475f6 100644 (file)
@@ -2685,6 +2685,11 @@ public:
     }
 
     void del_client (int client_id) {
+        ClientRepository::iterator iter = m_client_repository.find(client_id);
+        if (iter == m_client_repository.end()) {
+            LOGW("The client with id %d does not exist in our client repository, returning", client_id);
+            return;
+        }
         lock ();
         m_signal_close_connection (client_id);
         ClientInfo client_info = socket_get_client_info (client_id);