}
info->disconnect_idle_id = 0;
event_info = _bt_event_get_cb_data(BT_HID_DEVICE_EVENT);
- if (event_info == NULL)
- return FALSE;
+ if (event_info != NULL) {
+ memset(&bd_addr, 0x00, sizeof(bluetooth_device_address_t));
+ _bt_convert_addr_string_to_type(bd_addr.addr , info->address);
+ _bt_common_event_cb(BLUETOOTH_HID_DEVICE_DISCONNECTED,
+ BLUETOOTH_ERROR_NONE, &bd_addr,
+ event_info->cb, event_info->user_data);
+ }
- memset(&bd_addr, 0x00, sizeof(bluetooth_device_address_t));
- _bt_convert_addr_string_to_type(bd_addr.addr , info->address);
- _bt_common_event_cb(BLUETOOTH_HID_DEVICE_DISCONNECTED,
- BLUETOOTH_ERROR_NONE, &bd_addr,
- event_info->cb, event_info->user_data);
- if (info->address)
- g_free(info->address);
+ g_free(info->address);
g_free(info);
- info = NULL;
- BT_DBG("-");
+
return FALSE;
}