diff options
author | 2025-02-13 22:57:24 -0800 | |
---|---|---|
committer | 2025-02-17 17:52:19 -0800 | |
commit | 81793808b9347a52dd979e4b3d5d9d10fc8c4915 (patch) | |
tree | 51529ad19b47e374dcfe15cab26f910a6c4f5319 /libs/gui/BufferItem.cpp | |
parent | f6dc8535293c1614e9c08e6416fe67a3514ed0e8 (diff) |
Harden construction sites of android::StrongPointer.
Bug: 393217449
Test: presubmit
Flag: EXEMPT_refactor
Change-Id: Icf703aed608531e9b302b299481af00a52074731
Diffstat (limited to 'libs/gui/BufferItem.cpp')
-rw-r--r-- | libs/gui/BufferItem.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/gui/BufferItem.cpp b/libs/gui/BufferItem.cpp index 3b2d337a21..9dcd5dc4c5 100644 --- a/libs/gui/BufferItem.cpp +++ b/libs/gui/BufferItem.cpp @@ -215,14 +215,14 @@ status_t BufferItem::unflatten( FlattenableUtils::read(buffer, size, flags); if (flags & 1) { - mGraphicBuffer = new GraphicBuffer(); + mGraphicBuffer = sp<GraphicBuffer>::make(); status_t err = mGraphicBuffer->unflatten(buffer, size, fds, count); if (err) return err; size -= FlattenableUtils::align<4>(buffer); } if (flags & 2) { - mFence = new Fence(); + mFence = sp<Fence>::make(); status_t err = mFence->unflatten(buffer, size, fds, count); if (err) return err; size -= FlattenableUtils::align<4>(buffer); |