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

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

hci: Stop the thread before hci_close() am: 29c4eab0 am: fda6ce8a

am: 072f555d

Change-Id: I8da446dae69420595fd0d02eb6abd135b16c7e91
parents 958b1e25 072f555d
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);