mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
Clean websocket signal properly
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user