diff --git a/apps/streaming/java/src/net/i2p/client/streaming/ConnThrottler.java b/apps/streaming/java/src/net/i2p/client/streaming/ConnThrottler.java index 07430e751..5383873e9 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/ConnThrottler.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/ConnThrottler.java @@ -27,12 +27,11 @@ class ConnThrottler { ConnThrottler(int max, int totalMax, long period) { _max = max; _totalMax = totalMax; - if (max > 0) { - SimpleScheduler.getInstance().addPeriodicEvent(new Cleaner(), period); + SimpleScheduler.getInstance().addPeriodicEvent(new Cleaner(), period); + if (max > 0) this.counter = new ObjectCounter(); - } else { + else this.counter = null; - } if (totalMax > 0) _currentTotal = new AtomicInteger(); else