summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceControl.cpp
diff options
context:
space:
mode:
author chaviw <chaviw@google.com> 2020-05-27 15:16:15 -0700
committer chaviw <chaviw@google.com> 2020-05-27 15:16:15 -0700
commit1a4dba4b2bfa835599286e49514f44fd27e774f1 (patch)
tree608351188c2ea523c2c2bf2eefea7141abe99ed7 /libs/gui/SurfaceControl.cpp
parent68904ad94c9a6ab6294ac0d4394a191c1d4c7f02 (diff)
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
Diffstat (limited to 'libs/gui/SurfaceControl.cpp')
0 files changed, 0 insertions, 0 deletions