[#1885] Correctly close leak detected also on non started HashedWheelTimer

This commit is contained in:
Norman Maurer 2013-10-02 06:44:55 +02:00
parent a4a207fc4f
commit eb24b572dc

View File

@ -273,6 +273,11 @@ public class HashedWheelTimer implements Timer {
if (!workerState.compareAndSet(WORKER_STATE_STARTED, WORKER_STATE_SHUTDOWN)) {
// workerState can be 0 or 2 at this moment - let it always be 2.
workerState.set(WORKER_STATE_SHUTDOWN);
if (leak != null) {
leak.close();
}
return Collections.emptySet();
}