Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 68318be9 authored by Myles Watson's avatar Myles Watson Committed by android-build-merger
Browse files

hci: Close the HAL before cleaning up pending command queue and timers

am: 9bdfffdc

Change-Id: I5913c210da826c4cebef0b03478afe4f0c49a771
parents 50c42a52 9bdfffdc
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -220,6 +220,14 @@ error:
static future_t* hci_module_shut_down() {
  LOG_INFO(LOG_TAG, "%s", __func__);

  // Free the timers
  alarm_free(command_response_timer);
  command_response_timer = NULL;
  alarm_free(startup_timer);
  startup_timer = NULL;

  hci_close();

  if (thread) {
    thread_stop(thread);
    thread_join(thread);
@@ -234,14 +242,6 @@ static future_t* hci_module_shut_down() {

  packet_fragmenter->cleanup();

  // Free the timers
  alarm_free(command_response_timer);
  command_response_timer = NULL;
  alarm_free(startup_timer);
  startup_timer = NULL;

  hci_close();

  thread_free(thread);
  thread = NULL;