From aed7ad07e8ac7eba7ec22a1a763878ff27362224 Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Wed, 3 Aug 2022 15:04:33 -0700 Subject: Use sp<>::make instead of new For better refcount safety, use sp<>::make instead of new. After this change, sp t = new T(args..) will be prohibited at compile time. Bug: 241125940 Test: m checkinput Change-Id: I27806ca8f41e8d67744f3569c87a64241318c20b --- services/inputflinger/InputThread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services/inputflinger/InputThread.cpp') diff --git a/services/inputflinger/InputThread.cpp b/services/inputflinger/InputThread.cpp index b87f7a1243..e2e64f992f 100644 --- a/services/inputflinger/InputThread.cpp +++ b/services/inputflinger/InputThread.cpp @@ -41,7 +41,7 @@ private: InputThread::InputThread(std::string name, std::function loop, std::function wake) : mName(name), mThreadWake(wake) { - mThread = new InputThreadImpl(loop); + mThread = sp::make(loop); mThread->run(mName.c_str(), ANDROID_PRIORITY_URGENT_DISPLAY); } -- cgit v1.2.3-59-g8ed1b