summaryrefslogtreecommitdiff
path: root/services/inputflinger/InputThread.cpp
diff options
context:
space:
mode:
author Siarhei Vishniakou <svv@google.com> 2022-08-03 15:04:33 -0700
committer Siarhei Vishniakou <svv@google.com> 2022-08-04 02:47:39 +0000
commitaed7ad07e8ac7eba7ec22a1a763878ff27362224 (patch)
treeeb383211164404991e4e085255879cd60858d8a3 /services/inputflinger/InputThread.cpp
parentf9323e22ab5b78ab37a4a39865061f5b2cf5f2e7 (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.cpp2
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);
}