From 9045666047d55134c2e4f0108a88b5799653003e Mon Sep 17 00:00:00 2001 From: Anton Ivanov Date: Fri, 14 Mar 2025 14:56:12 -0700 Subject: Ensure Choreographer is held as sp<> in SurfaceControl. Test: ChoreographerTests pass Flag: EXEMPT refactor Bug: 393217449 Change-Id: I60d42f383d4b73b60de1a7a1bbeec5170b805ebb --- libs/gui/SurfaceControl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libs/gui/SurfaceControl.cpp') diff --git a/libs/gui/SurfaceControl.cpp b/libs/gui/SurfaceControl.cpp index 1eb9b87c3c..50877f8c56 100644 --- a/libs/gui/SurfaceControl.cpp +++ b/libs/gui/SurfaceControl.cpp @@ -194,7 +194,7 @@ const std::string& SurfaceControl::getName() const { return mName; } -std::shared_ptr SurfaceControl::getChoreographer() { +sp SurfaceControl::getChoreographer() { if (mChoreographer) { return mChoreographer; } @@ -203,7 +203,7 @@ std::shared_ptr SurfaceControl::getChoreographer() { ALOGE("%s: No looper prepared for thread", __func__); return nullptr; } - mChoreographer = std::make_shared(looper, getHandle()); + mChoreographer = sp::make(looper, getHandle()); status_t result = mChoreographer->initialize(); if (result != OK) { ALOGE("Failed to initialize choreographer"); -- cgit v1.2.3-59-g8ed1b