Skip to content

Commit da8987a

Browse files
committed
Fix timers leaking from debouncers
1 parent dc21e7a commit da8987a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pubsub/src/main/java/com/fastcomments/pubsub/LiveEventSubscriber.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,12 @@ private void cleanup() {
247247
reconnectTimer = null;
248248
}
249249

250+
// Clean up all debouncer timers
251+
for (Timer timer : debouncers.values()) {
252+
timer.cancel();
253+
}
254+
debouncers.clear();
255+
250256
// Initialize last event time if not set
251257
if (lastEventTime <= 0) {
252258
lastEventTime = new Date().getTime();

0 commit comments

Comments
 (0)