svace fixes done
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / bluez_hal / src / bt-hal-hdp-dbus-handler.c
index 767df54..5a74fc1 100644 (file)
@@ -426,7 +426,9 @@ err:
 
                ERR("Outgoing connection failed for app_id:%d, send event", conn_info->app_id);
                /* Send channel_connect callback with status: disconnected and fd = -1 */
-               __hdp_send_conn_event(conn_info, BTHL_CONN_STATE_DISCONNECTED);
+               if (event_cb)
+                       __hdp_send_conn_event(conn_info, BTHL_CONN_STATE_DISCONNECTED);
+
                app->conn_list = g_slist_remove(app->conn_list, conn_info);
                __hdp_free_conn_info(conn_info);
        }
@@ -452,7 +454,8 @@ static void __hdp_handle_disconnect(GVariant *parameters,
        }
 
        /* Send channel_connect callback with status: success */
-       __hdp_send_conn_event(conn_info, BTHL_CONN_STATE_DESTROYED);
+       if (event_cb)
+               __hdp_send_conn_event(conn_info, BTHL_CONN_STATE_DESTROYED);
 
        app = __get_hdp_app_by_id(conn_info->app_id);
        app->conn_list = g_slist_remove(app->conn_list, conn_info);
@@ -709,7 +712,8 @@ static void __hdp_connect_request_cb(GDBusProxy *hdp_proxy,
                        g_clear_error(&err);
                }
                /* Send channel_connect callback with status: disconnected and fd = -1 */
-               __hdp_send_conn_event(conn_info, BTHL_CONN_STATE_DISCONNECTED);
+               if (event_cb)
+                       __hdp_send_conn_event(conn_info, BTHL_CONN_STATE_DISCONNECTED);
                __hdp_free_conn_info(conn_info);
                return;
        }