summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-02-06 11:22:17 -0800
committerMathieu Chartier <mathieuc@google.com>2014-02-06 11:25:49 -0800
commit055d46c479369ea825712834353660b45215c195 (patch)
tree8d8074b21603975548118e06f1525e3c12d14f6a /runtime/runtime.cc
parent4c4f90c2d1776137e249c6720b83c81c09961dda (diff)
downloadart-055d46c479369ea825712834353660b45215c195.zip
art-055d46c479369ea825712834353660b45215c195.tar.gz
art-055d46c479369ea825712834353660b45215c195.tar.bz2
Add missing SIRT to LoadNativeLibrary.
When we transition to kWaitingForJniOnLoad, we are suspended and a GC can occur. This caused issues since classloaders are movable. Change-Id: Iae59019c22ac64322a82300107d06a4323ee602b
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r--runtime/runtime.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index d070207..bcd3d31 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -1087,7 +1087,8 @@ void Runtime::InitNativeMethods() {
std::string mapped_name(StringPrintf(OS_SHARED_LIB_FORMAT_STR, "javacore"));
std::string reason;
self->TransitionFromSuspendedToRunnable();
- if (!instance_->java_vm_->LoadNativeLibrary(mapped_name, NULL, &reason)) {
+ SirtRef<mirror::ClassLoader> class_loader(self, nullptr);
+ if (!instance_->java_vm_->LoadNativeLibrary(mapped_name, class_loader, &reason)) {
LOG(FATAL) << "LoadNativeLibrary failed for \"" << mapped_name << "\": " << reason;
}
self->TransitionFromRunnableToSuspended(kNative);