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/LayerState.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/LayerState.cpp')
-rw-r--r-- | libs/gui/LayerState.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp index 44aac9bfae..980c969d0d 100644 --- a/libs/gui/LayerState.cpp +++ b/libs/gui/LayerState.cpp @@ -691,7 +691,7 @@ void layer_state_t::merge(const layer_state_t& other) { } if (other.what & eInputInfoChanged) { what |= eInputInfoChanged; - windowInfoHandle = new WindowInfoHandle(*other.windowInfoHandle); + windowInfoHandle = sp<WindowInfoHandle>::make(*other.windowInfoHandle); } if (other.what & eBackgroundColorChanged) { what |= eBackgroundColorChanged; @@ -1009,13 +1009,13 @@ status_t BufferData::readFromParcel(const Parcel* input) { bool tmpBool = false; SAFE_PARCEL(input->readBool, &tmpBool); if (tmpBool) { - buffer = new GraphicBuffer(); + buffer = sp<GraphicBuffer>::make(); SAFE_PARCEL(input->read, *buffer); } SAFE_PARCEL(input->readBool, &tmpBool); if (tmpBool) { - acquireFence = new Fence(); + acquireFence = sp<Fence>::make(); SAFE_PARCEL(input->read, *acquireFence); } |