diff options
author | Benoit Foucher <benoit@zeroc.com> | 2003-06-30 15:27:09 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2003-06-30 15:27:09 +0000 |
commit | 51a11f122e6277367f1dc1046730c9882ce205db (patch) | |
tree | 2bb0c30ca856657c1f3258a38ade86021e52f26b /java/src/Ice/Application.java | |
parent | merging changes from Evictor branch (diff) | |
download | ice-51a11f122e6277367f1dc1046730c9882ce205db.tar.bz2 ice-51a11f122e6277367f1dc1046730c9882ce205db.tar.xz ice-51a11f122e6277367f1dc1046730c9882ce205db.zip |
Bug fix
Diffstat (limited to 'java/src/Ice/Application.java')
-rw-r--r-- | java/src/Ice/Application.java | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/java/src/Ice/Application.java b/java/src/Ice/Application.java index a5cd647eb67..158a5a63174 100644 --- a/java/src/Ice/Application.java +++ b/java/src/Ice/Application.java @@ -149,6 +149,24 @@ public abstract class Application synchronized public static void destroyOnInterrupt() { + // + // Remove the shutdown hook it's set. + // + if(_shutdownHook != null) + { + try + { + Runtime.getRuntime().removeShutdownHook(_shutdownHook); + _shutdownHook = null; + } + catch(java.lang.IllegalStateException ex) + { + // + // Expected if we are in the process of shutting down. + // + } + } + if(_destroyHook == null) { // @@ -174,6 +192,24 @@ public abstract class Application synchronized public static void shutdownOnInterrupt() { + // + // Remove the destroy hook if it's set. + // + if(_destroyHook != null) + { + try + { + Runtime.getRuntime().removeShutdownHook(_destroyHook); + _destroyHook = null; + } + catch(java.lang.IllegalStateException ex) + { + // + // Expected if we are in the process of shutting down. + // + } + } + if(_shutdownHook == null) { // @@ -213,6 +249,21 @@ public abstract class Application // } } + + if(_destroyHook != null) + { + try + { + Runtime.getRuntime().removeShutdownHook(_destroyHook); + _destroyHook = null; + } + catch(java.lang.IllegalStateException ex) + { + // + // Expected if we are in the process of shutting down. + // + } + } } synchronized public static boolean |