From dc576f9e9800aadc032fd8e1b54f177d0834b11c Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 25 Apr 2024 18:34:55 +0900 Subject: [PATCH] Fix crash issue on terminate Prevents autofill_service_send_error_info() invoke with a delegate handle that has already been disconnected Change-Id: I1fadac0127957ca9bcbff4ba3e09e5a94b818795 Signed-off-by: Jihoon Kim --- service_lib/autofill_service.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index 45ecc6a..d193df8 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -507,6 +507,21 @@ EXPORT_API int autofill_service_deinitialize(void) __client_list = NULL; } + if (g_auth_info_cb) + rpc_port_stub_AutofillSvcPort_autofill_svc_auth_info_cb_destroy(g_auth_info_cb); + + g_auth_info_cb = NULL; + + if (g_send_error_cb) + rpc_port_stub_AutofillSvcPort_autofill_svc_send_error_cb_destroy(g_send_error_cb); + + g_send_error_cb = NULL; + + if (g_fill_response_received_cb) + rpc_port_stub_AutofillSvcPort_autofill_svc_fill_response_cb_destroy(g_fill_response_received_cb); + + g_fill_response_received_cb = NULL; + rpc_port_stub_AutofillSvcPort_unregister(); __initialized = false; @@ -782,6 +797,8 @@ EXPORT_API int autofill_service_send_error_info(int context_id, autofill_error_i autofill_error_e error_code; rpc_port_stub_autofill_svc_error_info_h error_info_h = NULL; + LOGI("context id(%d)", context_id); + if (!h) { LOGW("[ERROR] Invalid parameter"); return AUTOFILL_ERROR_INVALID_PARAMETER; -- 2.7.4