natClass.cc (finalize): Make sure that the class really has an engine.
authorAndrew Haley <aph@redhat.com>
Tue, 12 Jul 2011 12:50:36 +0000 (12:50 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Tue, 12 Jul 2011 12:50:36 +0000 (12:50 +0000)
2011-07-12  Andrew Haley  <aph@redhat.com>

* java/lang/natClass.cc (finalize): Make sure that the class
really has an engine.

From-SVN: r176199

libjava/ChangeLog
libjava/java/lang/natClass.cc

index 684b4aa..4715590 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-12  Andrew Haley  <aph@redhat.com>
+
+       * java/lang/natClass.cc (finalize): Make sure that the class
+       really has an engine.
+
 2011-07-07  Matthias Klose  <doko@ubuntu.com>
 
        * libtool-version: Bump soversion.
index 9f9f05e..ec4a18f 100644 (file)
@@ -668,7 +668,9 @@ java::lang::Class::newInstance (void)
 void
 java::lang::Class::finalize (void)
 {
-  engine->unregister(this);
+  // Array classes don't have an engine, and don't need to be finalized.
+   if (engine)
+     engine->unregister(this);
 }
 
 #ifdef INTERPRETER