From 3c45bb833ad2d441a52a352ea7331368be279b59 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 17 Dec 2019 15:59:41 +0900 Subject: [PATCH] Fix crash on disconnection of client application Change-Id: Ie049625b72d3aea71ee113318c92ba68ee376441 Signed-off-by: Jihoon Kim --- src/autofill-daemon.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/autofill-daemon.c b/src/autofill-daemon.c index 4e762da..f0bd05b 100644 --- a/src/autofill-daemon.c +++ b/src/autofill-daemon.c @@ -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, -- 2.7.4