if (conn_info == NULL || svc_info == NULL || event_cb == NULL) {
g_variant_unref(var);
- if (response_needed)
- g_dbus_method_invocation_return_value(invocation, NULL);
- else
- g_object_unref(invocation);
+ g_dbus_method_invocation_return_value(invocation, NULL);
return;
}
/* Append request info in list of requests for the particular connection */
conn_info->gatt_req_info_list = g_slist_append(conn_info->gatt_req_info_list, req_info);
} else {
- g_object_unref(invocation);
+ /* Send reply now */
+ g_dbus_method_invocation_return_value(invocation, NULL);
}
/* Send HAL event */
if (svc_info == NULL || conn_info == NULL || event_cb == NULL) {
g_variant_unref(var);
- if (response_needed)
- g_dbus_method_invocation_return_value(invocation, NULL);
- else
- g_object_unref(invocation);
+ g_dbus_method_invocation_return_value(invocation, NULL);
return;
}
conn_info->gatt_req_info_list = g_slist_append(conn_info->gatt_req_info_list, req_info);
} else {
- g_object_unref(invocation);
+ /* Send reply now */
+ g_dbus_method_invocation_return_value(invocation, NULL);
}
/* Send HAL event */