Fix crash issue on terminate 25/310325/3
authorJihoon Kim <jihoon48.kim@samsung.com>
Thu, 25 Apr 2024 09:34:55 +0000 (18:34 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 26 Apr 2024 01:42:55 +0000 (10:42 +0900)
Prevents autofill_service_send_error_info() invoke with a delegate handle that has already been disconnected

Change-Id: I1fadac0127957ca9bcbff4ba3e09e5a94b818795
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
service_lib/autofill_service.c

index f98d4ed..3afd1b3 100644 (file)
@@ -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;