Make Shutdown() do something.

This commit is contained in:
Ian Gulliver
2016-01-08 15:22:47 -08:00
parent 918243b296
commit c9cb04d420

View File

@@ -50,7 +50,8 @@ hogfather.PublicChat = function(cosmo, id) {
this.dispatchEvent =
this.eventTarget_.dispatchEvent.bind(this.eventTarget_);
this.cosmo_.addEventListener('message', this.onMessage_.bind(this));
this.boundOnMessage_ = this.onMessage_.bind(this);
this.cosmo_.addEventListener('message', this.boundOnMessage_);
};
@@ -98,8 +99,12 @@ hogfather.PublicChat.prototype.Start_ = function() {
/**
* @return {Promise}
*/
hogfather.PublicChat.prototype.Shutdown = function() {
console.log(this.loggingPrefix_(), 'shutdown start');
this.cosmo_.removeEventListener('message', this.boundOnMessage_);
return this.cosmo_.unsubscribe(this.subject_);
};