@@ -77,8 +77,10 @@ MediaConnection.prototype.answer = function(stream) {
/** Allows user to close connection. */
MediaConnection.prototype.close = function() {
- if (this.open) {
- this.open = false;
- this.emit('close')
+ if (!this.open) {
+ return;
}
+ Negotiator.cleanup(this);
+ this.open = false;
+ this.emit('close')
};