summaryrefslogtreecommitdiff
path: root/libs/binder/ProcessState.cpp
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2021-04-12 21:09:03 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2021-04-12 21:09:03 +0000
commitd5cc17b3b45f32f1a74d963b2c59e39a12c46675 (patch)
treeb9331e64756e73b847d0996f1c4ab8c28c767e39 /libs/binder/ProcessState.cpp
parent369abe010a738a5c5e841cfeac82bd0fca7bfb1c (diff)
parent1a3a8effca802995ece193b7d40cd80abba55798 (diff)
Merge "libbinder use stronger refbase semantics"
Diffstat (limited to 'libs/binder/ProcessState.cpp')
-rw-r--r--libs/binder/ProcessState.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
index 82f6faf7a1..a8b2fb2ff8 100644
--- a/libs/binder/ProcessState.cpp
+++ b/libs/binder/ProcessState.cpp
@@ -105,7 +105,7 @@ sp<ProcessState> ProcessState::init(const char *driver, bool requireDefault)
}
std::lock_guard<std::mutex> l(gProcessMutex);
- gProcess = new ProcessState(driver);
+ gProcess = sp<ProcessState>::make(driver);
});
if (requireDefault) {
@@ -299,8 +299,8 @@ sp<IBinder> ProcessState::getStrongProxyForHandle(int32_t handle)
return nullptr;
}
- b = BpBinder::create(handle);
- e->binder = b;
+ sp<BpBinder> b = BpBinder::create(handle);
+ e->binder = b.get();
if (b) e->refs = b->getWeakRefs();
result = b;
} else {
@@ -340,7 +340,7 @@ void ProcessState::spawnPooledThread(bool isMain)
if (mThreadPoolStarted) {
String8 name = makeBinderThreadName();
ALOGV("Spawning new pooled thread, name=%s\n", name.string());
- sp<Thread> t = new PoolThread(isMain);
+ sp<Thread> t = sp<PoolThread>::make(isMain);
t->run(name.string());
}
}