Browse Source

Call cleanup in media connection close

ericz 11 years ago
parent
commit
891c1e722a
1 changed files with 5 additions and 3 deletions
  1. 5 3
      lib/mediaconnection.js

+ 5 - 3
lib/mediaconnection.js

@@ -77,8 +77,10 @@ MediaConnection.prototype.answer = function(stream) {
 
 
 /** Allows user to close connection. */
 /** Allows user to close connection. */
 MediaConnection.prototype.close = function() {
 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')
 };
 };