From 104db83a1cff704bebb5425ff4318047adcbb3ee Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Sat, 12 Dec 2020 00:13:02 +0100 Subject: [PATCH] Clean websocket signal properly --- clapper_src/playerBase.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/clapper_src/playerBase.js b/clapper_src/playerBase.js index ceabf855..f4aa4633 100644 --- a/clapper_src/playerBase.js +++ b/clapper_src/playerBase.js @@ -292,12 +292,16 @@ class ClapperPlayerBase extends GstPlayer.Player this.webserver = new WebServer(settings.get_int('webserver-port')); this.webserver.startListening(); - this.websocketSignal = this.webserver.connect( - 'websocket-data', this._onWsData.bind(this) - ); + + if(!this.websocketSignal) { + this.websocketSignal = this.webserver.connect( + 'websocket-data', this._onWsData.bind(this) + ); + } } else if(this.webserver) { this.webserver.disconnect(this.websocketSignal); + this.websocketSignal = null; this.webserver.stopListening(); } break;