Skip to content

Commit

Permalink
fix: Properly terminate protocol
Browse files Browse the repository at this point in the history
Addresses #345
  • Loading branch information
zusorio committed Jan 8, 2025
1 parent 18fa8d8 commit 370a064
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions html5/js/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ class XpraClient {
this.connected = false;
if (this.protocol) {
this.protocol.close();
this.protocol.terminate();
this.protocol = null;
}
}
Expand Down Expand Up @@ -2397,18 +2398,14 @@ class XpraClient {
do_reconnect() {
//try again:
this.reconnect_in_progress = true;
const protocol = this.protocol;
setTimeout(() => {
try {
this.remove_windows();
this.close_audio();
this.cancel_all_files();
this.clear_timers();
this.init_state();
if (protocol) {
this.protocol = null;
protocol.terminate();
}
this.close_protocol();
this.emit_connection_lost();
this.connect();
} finally {
Expand Down

0 comments on commit 370a064

Please sign in to comment.