summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueueThreadState.cpp
diff options
context:
space:
mode:
author Robert Carr <racarr@google.com> 2020-11-02 14:14:34 -0800
committer Robert Carr <racarr@google.com> 2020-11-02 14:19:32 -0800
commitfbcbb4c0258b0e05b310e35d76310480e4933d63 (patch)
treef730d1518be4dac659651e1508547be4bf282de5 /libs/gui/BufferQueueThreadState.cpp
parent08a8d53960e91d453ab479e6f41eb8c46a556d1f (diff)
BLASTBufferQueue: Hold sp in transactionCallbackThunk
When expecting a callback we perform an incStrong on the BBQ in order to ensure the lifetime extends at least as long as the callback. We remove this reference in BBQ::transactionCallback. The current implementation however has a bug, notice the scope of the lock around mMutex in transactionCallback extends to the whole function. This means after calling decStrong, we may then attempt to unlock the mutex when exiting the function, but we've already destroyed the object. We could move the decStrong to transactionCallbackThunk but the most clear/least brittle fix seems to simply be to hold a sp from transactionCallbackThunk and prevent the object from being destroyed while in a member method. Bug: 168506246 Test: Existing tests pass Change-Id: I905469f58dc7a2e2831b3b29726a42abd394f819
Diffstat (limited to 'libs/gui/BufferQueueThreadState.cpp')
0 files changed, 0 insertions, 0 deletions