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

Skip to content
Commit fbcbb4c0 authored by Robert Carr's avatar Robert Carr
Browse files

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
parent 08a8d539
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