Commit 11f63f6b authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Fixed NPE.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6392 b35dd754-fafc-0310-a699-88a17e54d16e
parent 8b3aa9d6
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
package org.jivesoftware.util; package org.jivesoftware.util;
import java.util.Date;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
import java.util.Date;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
/** /**
...@@ -252,12 +252,16 @@ public class TaskEngine { ...@@ -252,12 +252,16 @@ public class TaskEngine {
* Shuts down the task engine service. * Shuts down the task engine service.
*/ */
public void shutdown() { public void shutdown() {
if (executor != null) {
executor.shutdownNow(); executor.shutdownNow();
executor = null; executor = null;
}
if (timer != null) {
timer.cancel(); timer.cancel();
timer = null; timer = null;
} }
}
/** /**
* Wrapper class for a standard TimerTask. It simply executes the TimerTask * Wrapper class for a standard TimerTask. It simply executes the TimerTask
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment