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

Skip to content
Commit 1a4dba4b authored by chaviw's avatar chaviw
Browse files

Hold mMutex lock and check abandoned when accessing mLayer

The Layer lifecycle is tied to BufferLayerConsumer so when the Layer is
removed, the BufferLayerConsumer is abandoned. However, abandoned
doesn't necessarily mean it was cleaned up yet. Therefore, we need to
check whether the BufferLayerConsumer was abandoned before accessing the
raw pointer mLayer. If the BufferLayerConsumer was not abandoned, then
mLayer will be valid.

Test: Builds and runs. Hard to reproduce race condition
Fixes: 157535966
Fixes: 155679049
Change-Id: I8b309c9e1fe57746bceabab1deda56248087b189
parent 68904ad9
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