mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
base: Shutdown websocket server on unload
This commit is contained in:
parent
20de7409d8
commit
b61cf82e84
@ -25,6 +25,10 @@ class WebSocketServer : public QObject
|
||||
void Stop();
|
||||
void InvalidateSession(websocketpp::connection_hdl hdl);
|
||||
|
||||
bool IsListening() {
|
||||
return _server.is_listening();
|
||||
}
|
||||
|
||||
struct WebSocketState {
|
||||
websocketpp::connection_hdl hdl;
|
||||
std::string remoteAddress;
|
||||
|
@ -60,6 +60,12 @@ bool obs_module_load(void)
|
||||
|
||||
void obs_module_unload()
|
||||
{
|
||||
blog(LOG_INFO, "Shutting down...");
|
||||
if (_webSocketServer->IsListening()) {
|
||||
blog(LOG_INFO, "WebSocket server is running. Stopping...");
|
||||
_webSocketServer->Stop();
|
||||
}
|
||||
|
||||
_config.reset();
|
||||
_webSocketServer.reset();
|
||||
blog(LOG_INFO, "Finished shutting down.");
|
||||
|
Loading…
Reference in New Issue
Block a user