Skip to content

Commit

Permalink
Ignore exception when removing ShutdownHook on shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
sarxos committed Jan 11, 2013
1 parent 0190efb commit 2cca85b
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -587,7 +587,11 @@ protected void dispose() {
// hook can be null because there is a possibility that webcam has never
// been open and therefore hook was not created
if (hook != null) {
Runtime.getRuntime().removeShutdownHook(hook);
try {
Runtime.getRuntime().removeShutdownHook(hook);
} catch (IllegalStateException e) {
// ignore, it means that shutdown is in progress
}
}

open = false;
Expand Down

0 comments on commit 2cca85b

Please sign in to comment.