don't run Java finalizers when exiting the VM

This commit is contained in:
Joel Dice 2009-07-28 16:58:01 -06:00
parent 14e73560bb
commit 7b183e8f4e

View File

@ -484,6 +484,12 @@ postCollect(Thread* t)
void void
finalizeObject(Thread* t, object o) finalizeObject(Thread* t, object o)
{ {
if (t->state == Thread::ExitState) {
// don't waste time running Java finalizers if we're exiting the
// VM
return;
}
for (object c = objectClass(t, o); c; c = classSuper(t, c)) { for (object c = objectClass(t, o); c; c = classSuper(t, c)) {
for (unsigned i = 0; i < arrayLength(t, classMethodTable(t, c)); ++i) { for (unsigned i = 0; i < arrayLength(t, classMethodTable(t, c)); ++i) {
object m = arrayBody(t, classMethodTable(t, c), i); object m = arrayBody(t, classMethodTable(t, c), i);