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

Skip to content
Commit 85f386c2 authored by Jeremy Wu's avatar Jeremy Wu
Browse files

Floss: prevent sequence checker crashes with |Start/StopAudioTicks|

The weak pointer to |worker_thread_| is generated in the main
thread (via |ConfirmStreamRequest| -> |StartAudioTicks| ->
|audio_timer_.SchedulePeriodic(worker_thread->GetWeakPtr(), ...)|),
but |SchedulePeriodic| will result in dereferencing that weak
pointer in its later recurring tasks within the |worker_thread_|.

This violates the requirement where this |WeakPtr| should only
be dereferenced (or even null-checked) on the same sequence
where it is created.

This CL fixes the ownership of the thread similar to how
|btif_a2dp_source_start_audio_req| invokes the periodic function.

Bug: 319377916
Bug: 325984257
Test: m Bluetooth
Change-Id: Id79c5960491d2ef8b3586268306e3438f6288785
parent 182d20e0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment