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

Commit 3f09bbeb authored by Pavlin Radoslavov's avatar Pavlin Radoslavov Committed by android-build-merger
Browse files

Free the A2DP Source media alarm on the A2DP Source worker thread

am: e2fbecd5

Change-Id: I03ca80ed2cdeae946b0f6862268e90491a8fbe8c
parents fa85246c e2fbecd5
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -414,10 +414,6 @@ void btif_a2dp_source_shutdown(void) {

  APPL_TRACE_EVENT("## A2DP SOURCE STOP MEDIA THREAD ##");

  // Stop the timer
  alarm_free(btif_a2dp_source_cb.media_alarm);
  btif_a2dp_source_cb.media_alarm = nullptr;

  // Exit the thread
  btif_a2dp_source_thread.DoInThread(
      FROM_HERE, base::Bind(&btif_a2dp_source_shutdown_delayed));
@@ -425,6 +421,10 @@ void btif_a2dp_source_shutdown(void) {
}

static void btif_a2dp_source_shutdown_delayed(void) {
  // Stop the timer
  alarm_free(btif_a2dp_source_cb.media_alarm);
  btif_a2dp_source_cb.media_alarm = nullptr;

  btif_a2dp_control_cleanup();
  fixed_queue_free(btif_a2dp_source_cb.tx_audio_queue, nullptr);
  btif_a2dp_source_cb.tx_audio_queue = nullptr;