summaryrefslogtreecommitdiff
path: root/libs/gui/BLASTBufferQueue.cpp
diff options
context:
space:
mode:
author chaviw <chaviw@google.com> 2021-03-23 17:27:20 -0500
committer chaviw <chaviw@google.com> 2021-03-23 18:50:27 -0500
commitaad6cf53e8cf0f527d2ef0415922f04ad1b8680f (patch)
tree71ea6bcd9cc82a189bea8c1372feb5e147df8c3f /libs/gui/BLASTBufferQueue.cpp
parentb05e90288e6e0179bd06c33bd9cadc349eb2879b (diff)
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
Diffstat (limited to 'libs/gui/BLASTBufferQueue.cpp')
-rw-r--r--libs/gui/BLASTBufferQueue.cpp4
1 files changed, 3 insertions, 1 deletions
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();
}
}