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

Skip to content
Commit 15897e45 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

Fix non-blocking playback threads creation

Because PlaybackThread calls StreamOutHal::setCallback inside
the constructor, onFirstRef gets called while the vtable pointer
is set to PlaybackThread's vtable, not to its subclass vtable.
onFirstRef launches a thread which starts calling methods
that are abstract in PlaybackThread.

Fixed by changing the type of StreamOutHal::setCallback argument
from "sp" to "wp", as creating a weak pointer does not increase
strong refs count and thus doesn't call onFirstRef.

Bug: 31856492
Change-Id: I0d51bc73ca88b4b235260ed773870ecb7dac55d0
Test: added logging to verify the order of calls
parent ad111520
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment