hotspot/src/share/vm/classfile/classFileParser.cpp
changeset 23872 536c66fc43d3
parent 22752 5796083e0729
child 24086 b0a609eb2b31
child 23875 9c5200481921
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Tue Apr 08 11:50:01 2014 +0200
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Tue Apr 08 13:58:38 2014 -0400
@@ -4180,8 +4180,12 @@
 
   clear_class_metadata();
 
-  // deallocate the klass if already created.
-  MetadataFactory::free_metadata(_loader_data, _klass);
+  // deallocate the klass if already created.  Don't directly deallocate, but add
+  // to the deallocate list so that the klass is removed from the CLD::_klasses list
+  // at a safepoint.
+  if (_klass != NULL) {
+    _loader_data->add_to_deallocate_list(_klass);
+  }
   _klass = NULL;
 }