From a6e8d22d0686d860df735082c151f71157567e06 Mon Sep 17 00:00:00 2001 From: Nick Hudson Date: Wed, 22 Jul 2015 11:08:43 +0100 Subject: Tidy up finalize method in SimpleEventLoop If the finalize() ever gets called, it should, by convention, invoke the superclass finalize() method. This change makes it do that. Test-information: Unit tests still pass Change-Id: I0171cb1b6e1cce61a4c3140f669585f14e797dbd diff --git a/src/com/isode/stroke/eventloop/SimpleEventLoop.java b/src/com/isode/stroke/eventloop/SimpleEventLoop.java index a471457..c3919eb 100644 --- a/src/com/isode/stroke/eventloop/SimpleEventLoop.java +++ b/src/com/isode/stroke/eventloop/SimpleEventLoop.java @@ -26,11 +26,16 @@ public class SimpleEventLoop extends EventLoop { @Override protected void finalize() throws Throwable { - synchronized (eventsMutex_) { - if (!events_.isEmpty()) { - System.err.println("Warning: Pending events in SimpleEventLoop at finalize time"); - } - } + try { + synchronized (eventsMutex_) { + if (!events_.isEmpty()) { + System.err.println("Warning: Pending events in SimpleEventLoop at finalize time"); + } + } + } + finally { + super.finalize(); + } } public void run() { -- cgit v0.10.2-6-g49f6