OSDN Git Service

Revert "Revert "Remove double unloading hack""
authorMathieu Chartier <mathieuc@google.com>
Tue, 10 May 2016 17:11:48 +0000 (10:11 -0700)
committerMathieu Chartier <mathieuc@google.com>
Tue, 10 May 2016 17:11:48 +0000 (10:11 -0700)
This reverts commit e9cae49599856fe737cee87783438d2c5dabccfe.

runtime/common_runtime_test.cc

index f58af5a..5bdb36c 100644 (file)
@@ -418,26 +418,6 @@ void CommonRuntimeTestImpl::TearDown() {
   (*icu_cleanup_fn)();
 
   Runtime::Current()->GetHeap()->VerifyHeap();  // Check for heap corruption after the test
-
-  // Manually closing the JNI libraries.
-  // Runtime does not support repeatedly doing JNI->CreateVM, thus we need to manually clean up the
-  // dynamic linking loader so that gtests would not fail.
-  // Bug: 25785594
-  if (runtime_->IsStarted()) {
-    {
-      // We retrieve the handle by calling dlopen on the library. To close it, we need to call
-      // dlclose twice, the first time to undo our dlopen and the second time to actually unload it.
-      // See man dlopen.
-      void* handle = dlopen("libjavacore.so", RTLD_LAZY);
-      dlclose(handle);
-      CHECK_EQ(0, dlclose(handle));
-    }
-    {
-      void* handle = dlopen("libopenjdkd.so", RTLD_LAZY);
-      dlclose(handle);
-      CHECK_EQ(0, dlclose(handle));
-    }
-  }
 }
 
 static std::string GetDexFileName(const std::string& jar_prefix, bool host) {