Clear poll timer on channel unload

This commit is contained in:
Calvin Montgomery 2014-05-21 20:21:03 -07:00
parent a3469378aa
commit ac629d4b7f
1 changed files with 6 additions and 0 deletions

View File

@ -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) {