From 2558c6054e42adf217c513c6b8272c358cb89265 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Tue, 12 Jul 2011 12:50:36 +0000 Subject: [PATCH] natClass.cc (finalize): Make sure that the class really has an engine. 2011-07-12 Andrew Haley * java/lang/natClass.cc (finalize): Make sure that the class really has an engine. From-SVN: r176199 --- libjava/ChangeLog | 5 +++++ libjava/java/lang/natClass.cc | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 684b4aa88f5..4715590d9e7 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2011-07-12 Andrew Haley + + * java/lang/natClass.cc (finalize): Make sure that the class + really has an engine. + 2011-07-07 Matthias Klose * libtool-version: Bump soversion. diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc index 9f9f05ed8e5..ec4a18f1b51 100644 --- a/libjava/java/lang/natClass.cc +++ b/libjava/java/lang/natClass.cc @@ -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 -- 2.30.2