Fix crash on disconnection of client application 20/220320/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 17 Dec 2019 06:59:41 +0000 (15:59 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 17 Dec 2019 06:59:41 +0000 (15:59 +0900)
Change-Id: Ie049625b72d3aea71ee113318c92ba68ee376441
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/autofill-daemon.c

index 4e762da..16d17e6 100644 (file)
@@ -199,6 +199,17 @@ static void __client_create(rpc_port_stub_AutofillAppPort_context_h context,
     free(sender);
 }
 
+static gboolean client_remove_cb(void *data)
+{
+    rpc_port_stub_AutofillAppPort_context_h context = data;
+
+    LOGD("client remove callback (%p)", context);
+
+    __remove_client(context);
+
+    return false;
+}
+
 static void __client_terminate(rpc_port_stub_AutofillAppPort_context_h context,
         void *user_data)
 {
@@ -212,7 +223,7 @@ static void __client_terminate(rpc_port_stub_AutofillAppPort_context_h context,
     LOGD("[__RPC_PORT__] sender(%s)", sender);
     free(sender);
 
-    __remove_client(context);
+    g_idle_add(client_remove_cb, context);
 }
 
 static int __client_register(rpc_port_stub_AutofillAppPort_context_h context,