summaryrefslogtreecommitdiff
path: root/libs/gui/IGraphicBufferProducerFlattenables.cpp
diff options
context:
space:
mode:
author Anton Ivanov <aii@google.com> 2025-02-20 11:52:50 -0800
committer Anton Ivanov <aii@google.com> 2025-02-26 10:51:53 -0800
commit8ed86598b8e5ee2ef1bf1f69e467489e620635e0 (patch)
treeaaea52463dcc535ab2a56ad8941c7d21025ef226 /libs/gui/IGraphicBufferProducerFlattenables.cpp
parentaf9a9ce3f96c6a31684f3b5885722919a1f5ec62 (diff)
Revert^2 "Harden construction sites of android::StrongPointer."
This reverts commit f73db7a6242e297ead71df0d0d1fb3a8515245d3. Reason for revert: Scope restricted to sp<>::make which is a safe replacement for assignment from new. Bug: 393217449 Test: ChoreographerTests pass locally. Flag: EXEMPT_refactor Change-Id: I9a38c54c06cc64da099d282c05ccf20f40b70a72
Diffstat (limited to 'libs/gui/IGraphicBufferProducerFlattenables.cpp')
-rw-r--r--libs/gui/IGraphicBufferProducerFlattenables.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/gui/IGraphicBufferProducerFlattenables.cpp b/libs/gui/IGraphicBufferProducerFlattenables.cpp
index 8b2e2ddc59..393e1c3068 100644
--- a/libs/gui/IGraphicBufferProducerFlattenables.cpp
+++ b/libs/gui/IGraphicBufferProducerFlattenables.cpp
@@ -105,7 +105,7 @@ status_t IGraphicBufferProducer::QueueBufferInput::unflatten(
: std::nullopt;
#endif // COM_ANDROID_GRAPHICS_LIBUI_FLAGS_APPLY_PICTURE_PROFILES
- fence = new Fence();
+ fence = sp<Fence>::make();
status_t result = fence->unflatten(buffer, size, fds, count);
if (result != NO_ERROR) {
return result;
@@ -228,7 +228,7 @@ status_t IGraphicBufferProducer::RequestBufferOutput::unflatten(
FlattenableUtils::read(fBuffer, size, result);
int32_t isBufferNull = 0;
FlattenableUtils::read(fBuffer, size, isBufferNull);
- buffer = new GraphicBuffer();
+ buffer = sp<GraphicBuffer>::make();
if (!isBufferNull) {
status_t status = buffer->unflatten(fBuffer, size, fds, count);
if (status != NO_ERROR) {
@@ -323,7 +323,7 @@ status_t IGraphicBufferProducer::DequeueBufferOutput::unflatten(
FlattenableUtils::read(buffer, size, slot);
FlattenableUtils::read(buffer, size, bufferAge);
- fence = new Fence();
+ fence = sp<Fence>::make();
status_t status = fence->unflatten(buffer, size, fds, count);
if (status != NO_ERROR) {
return status;
@@ -395,7 +395,7 @@ status_t IGraphicBufferProducer::CancelBufferInput::unflatten(
FlattenableUtils::read(buffer, size, slot);
- fence = new Fence();
+ fence = sp<Fence>::make();
return fence->unflatten(buffer, size, fds, count);
}