From ac629d4b7f606fd91fbb40f26c3cea8d64f07475 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Wed, 21 May 2014 20:21:03 -0700 Subject: [PATCH] Clear poll timer on channel unload --- lib/channel/poll.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/channel/poll.js b/lib/channel/poll.js index 437696e7..cb320fcd 100644 --- a/lib/channel/poll.js +++ b/lib/channel/poll.js @@ -24,6 +24,12 @@ function PollModule(channel) { PollModule.prototype = Object.create(ChannelModule.prototype); +PollModule.prototype.unload = function () { + if (this.poll && this.poll.timer) { + clearTimeout(this.poll.timer); + } +}; + PollModule.prototype.load = function (data) { if ("poll" in data) { if (data.poll !== null) {