diff options
Diffstat (limited to 'src/org/traccar/Main.java')
-rw-r--r-- | src/org/traccar/Main.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/org/traccar/Main.java b/src/org/traccar/Main.java index a51fa80bf..7ff93fda6 100644 --- a/src/org/traccar/Main.java +++ b/src/org/traccar/Main.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2013 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2012 - 2015 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,11 +34,11 @@ public final class Main { Context.getWebServer().start(); } - // Shutdown server properly Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { Log.info("Shutting down server..."); + if (Context.getWebServer() != null) { Context.getWebServer().stop(); } |