From aad6cf53e8cf0f527d2ef0415922f04ad1b8680f Mon Sep 17 00:00:00 2001 From: chaviw Date: Tue, 23 Mar 2021 17:27:20 -0500 Subject: Clear transaction that's passed to mergeWithNextTransaction The std::move wasn't actually clearing the incoming transaction so it was possible for the transaction to get applied by something else. This would cause unexpected behavior since the caller intented for the transaction to be merged with the next frame. Instead, just explicitly clear the transaction after storing in the vector. Test: No longer flickers when resizing pip Fixes: 182985130 Change-Id: Ie6ed0825074fb51ae3c260832002c012606241a1 --- libs/gui/BLASTBufferQueue.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libs/gui/BLASTBufferQueue.cpp') diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp index f778232803..ab75d03312 100644 --- a/libs/gui/BLASTBufferQueue.cpp +++ b/libs/gui/BLASTBufferQueue.cpp @@ -608,7 +608,9 @@ void BLASTBufferQueue::mergeWithNextTransaction(SurfaceComposerClient::Transacti // Apply the transaction since we have already acquired the desired frame. t->apply(); } else { - mPendingTransactions.emplace_back(frameNumber, std::move(*t)); + mPendingTransactions.emplace_back(frameNumber, *t); + // Clear the transaction so it can't be applied elsewhere. + t->clear(); } } -- cgit v1.2.3-59-g8ed1b