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

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

hci: Stop the thread before hci_close()

am: 29c4eab0

Change-Id: I639ddc9eb768a260186e06ea03d49c1d2c76f929
parents 4a7730e0 29c4eab0
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -226,13 +226,15 @@ static future_t* hci_module_shut_down() {
  alarm_free(startup_timer);
  startup_timer = NULL;

  hci_close();

  // Stop the thread to prevent Send() calls.
  if (thread) {
    thread_stop(thread);
    thread_join(thread);
  }

  // Close HCI to prevent callbacks.
  hci_close();

  fixed_queue_free(command_queue, osi_free);
  command_queue = NULL;
  fixed_queue_free(packet_queue, buffer_allocator->free);