diff options
author | Nick Hudson <nick.hudson@isode.com> | 2015-07-22 10:08:43 (GMT) |
---|---|---|
committer | Nick Hudson <nick.hudson@isode.com> | 2015-07-22 14:14:30 (GMT) |
commit | a6e8d22d0686d860df735082c151f71157567e06 (patch) | |
tree | 614f6f6244e3695ad2765e567b0cba0b35969c28 /src/com | |
parent | e98df2cfcd3bc553b16c139a7d2adfcbe672b540 (diff) | |
download | stroke-a6e8d22d0686d860df735082c151f71157567e06.zip stroke-a6e8d22d0686d860df735082c151f71157567e06.tar.bz2 |
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
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/isode/stroke/eventloop/SimpleEventLoop.java | 15 |
1 files changed, 10 insertions, 5 deletions
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() { |