소스 검색

Call cleanup in media connection close

ericz 12 년 전
부모
커밋
891c1e722a
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  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. */
 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')
 };