diff options
author | 2022-08-03 15:04:33 -0700 | |
---|---|---|
committer | 2022-08-04 02:47:39 +0000 | |
commit | aed7ad07e8ac7eba7ec22a1a763878ff27362224 (patch) | |
tree | eb383211164404991e4e085255879cd60858d8a3 /services/inputflinger/InputThread.cpp | |
parent | f9323e22ab5b78ab37a4a39865061f5b2cf5f2e7 (diff) |
Use sp<>::make instead of new
For better refcount safety, use sp<>::make instead of new.
After this change, sp<T> t = new T(args..) will be prohibited at compile
time.
Bug: 241125940
Test: m checkinput
Change-Id: I27806ca8f41e8d67744f3569c87a64241318c20b
Diffstat (limited to 'services/inputflinger/InputThread.cpp')
-rw-r--r-- | services/inputflinger/InputThread.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<void()> loop, std::function<void()> wake) : mName(name), mThreadWake(wake) { - mThread = new InputThreadImpl(loop); + mThread = sp<InputThreadImpl>::make(loop); mThread->run(mName.c_str(), ANDROID_PRIORITY_URGENT_DISPLAY); } |