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

Commit 29c4eab0 authored by Myles Watson's avatar Myles Watson
Browse files

hci: Stop the thread before hci_close()

Bug:36026072
Test: Switch users (toggle Bluetooth under load)
Change-Id: I3fb901b5c47021c708c1fb548858406225065d00
parent 3a3e2ef5
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);