diff --git a/core/rfb.js b/core/rfb.js index eb5f29b5..ca173eae 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -246,7 +246,7 @@ }); this._init_vars(); - this._cleanupSocket(); + this._cleanup(); var rmode = this._display.get_render_mode(); Util.Info("Using native WebSockets, render mode: " + rmode); @@ -408,7 +408,7 @@ } }, - _cleanupSocket: function () { + _cleanup: function () { if (this._msgTimer) { clearInterval(this._msgTimer); this._msgTimer = null; @@ -424,8 +424,6 @@ this._display.clear(); } } - - this._sock.close(); }, /* @@ -494,8 +492,8 @@ break; case 'disconnecting': - // WebSocket.onclose transitions to 'disconnected' - this._cleanupSocket(); + this._cleanup(); + this._sock.close(); // transitions to 'disconnected' this._disconnTimer = setTimeout(function () { this._rfb_disconnect_reason = "Disconnect timeout";