[vmkit-commits] [vmkit] r183667 - Setting class loader internal references to NULL pointers once they are no more usable. Class loaders reused after their destruction would be discovered earlier now. NOTICE: J3 does NOT correctly support Java object resurrection now.

Koutheir Attouchi koutheir at gmail.com
Mon Jun 10 08:22:36 PDT 2013


Author: koutheir
Date: Mon Jun 10 10:22:36 2013
New Revision: 183667

URL: http://llvm.org/viewvc/llvm-project?rev=183667&view=rev
Log:
Setting class loader internal references to NULL pointers once they are no more usable. Class loaders reused after their destruction would be discovered earlier now. NOTICE: J3 does NOT correctly support Java object resurrection now.

Modified:
    vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp

Modified: vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp?rev=183667&r1=183666&r2=183667&view=diff
==============================================================================
--- vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp (original)
+++ vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp Mon Jun 10 10:22:36 2013
@@ -879,29 +879,38 @@ JnjvmClassLoader::~JnjvmClassLoader() {
   if (classes) {
     classes->~ClassMap();
     allocator.Deallocate(classes);
+    classes = NULL;
   }
 
   if (hashUTF8) {
     hashUTF8->~UTF8Map();
     allocator.Deallocate(hashUTF8);
+    hashUTF8 = NULL;
   }
 
   if (javaTypes) {
     javaTypes->~TypeMap();
     allocator.Deallocate(javaTypes);
+    javaTypes = NULL;
   }
 
   if (javaSignatures) {
     javaSignatures->~SignMap();
     allocator.Deallocate(javaSignatures);
+    javaSignatures = NULL;
   }
 
-  for (std::vector<void*>::iterator i = nativeLibs.begin(); 
-       i < nativeLibs.end(); ++i) {
+  for (std::vector<void*>::iterator
+    i = nativeLibs.begin(), e = nativeLibs.end(); i != e; ++i)
+  {
     dlclose(*i);
   }
+  nativeLibs.clear();
+
+  vm = NULL;
 
   delete TheCompiler;
+  TheCompiler = NULL;
 
   // Don't delete the allocator. The caller of this method must
   // delete it after the current object is deleted.





More information about the vmkit-commits mailing list