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

Commit 30bb89af 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

am: 3f09bbeb

Change-Id: I6de0382140faa536688580741cf990326c5baca0
parents a6283fc2 3f09bbeb
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;