From 6ae41546898ac406e9595d8f31a6c14af015f55a Mon Sep 17 00:00:00 2001 From: mdb Date: Wed, 30 May 2001 00:25:53 +0000 Subject: [PATCH] Put didShutdown() in a finally block so that it is called even if iterate() or willStart() throws some runtime exception. git-svn-id: https://samskivert.googlecode.com/svn/trunk@133 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../java/com/samskivert/util/LoopingThread.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/projects/samskivert/src/java/com/samskivert/util/LoopingThread.java b/projects/samskivert/src/java/com/samskivert/util/LoopingThread.java index 58b7cfc5..dc864eaf 100644 --- a/projects/samskivert/src/java/com/samskivert/util/LoopingThread.java +++ b/projects/samskivert/src/java/com/samskivert/util/LoopingThread.java @@ -1,5 +1,5 @@ // -// $Id: LoopingThread.java,v 1.1 2001/05/29 03:29:44 mdb Exp $ +// $Id: LoopingThread.java,v 1.2 2001/05/30 00:25:53 mdb Exp $ package com.samskivert.util; @@ -34,11 +34,16 @@ public class LoopingThread extends Thread */ public void run () { - willStart(); - while (isRunning()) { - iterate(); + try { + willStart(); + + while (isRunning()) { + iterate(); + } + + } finally { + didShutdown(); } - didShutdown(); } /**