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 07430e7511ae44d92bc9e5b5f9de706acab04569..5383873e9cb3718a45a115f47b70facfd413a283 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