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
This commit is contained in:
mdb
2001-05-30 00:25:53 +00:00
parent adcb322b83
commit 6ae4154689
@@ -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();
}
/**