summaryrefslogtreecommitdiff
path: root/runtime/interpreter/unstarted_runtime.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/interpreter/unstarted_runtime.cc')
-rw-r--r--runtime/interpreter/unstarted_runtime.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/runtime/interpreter/unstarted_runtime.cc b/runtime/interpreter/unstarted_runtime.cc
index 5678732c9b..c1cae6f124 100644
--- a/runtime/interpreter/unstarted_runtime.cc
+++ b/runtime/interpreter/unstarted_runtime.cc
@@ -1112,18 +1112,14 @@ void UnstartedRuntime::UnstartedThreadCurrentThread(
// thread as unstarted to the ThreadGroup. A faked-up main thread peer is good enough for
// these purposes.
Runtime::Current()->InitThreadGroups(self);
- jobject main_peer =
- self->CreateCompileTimePeer(self->GetJniEnv(),
- "main",
- false,
- Runtime::Current()->GetMainThreadGroup());
+ ObjPtr<mirror::Object> main_peer = self->CreateCompileTimePeer(
+ "main", /*as_daemon=*/ false, Runtime::Current()->GetMainThreadGroup());
if (main_peer == nullptr) {
AbortTransactionOrFail(self, "Failed allocating peer");
return;
}
- result->SetL(self->DecodeJObject(main_peer));
- self->GetJniEnv()->DeleteLocalRef(main_peer);
+ result->SetL(main_peer);
} else {
AbortTransactionOrFail(self,
"Thread.currentThread() does not support %s",