fredemmott / streaming-remote

Control OBS Studio or XSplit Broadcaster over a network
Other
21 stars 5 forks source link

Crash if a client connection was previously closed #13

Closed fredemmott closed 3 years ago

fredemmott commented 3 years ago

Repro:

  1. open OBS
  2. connect webclient
  3. refresh webclient (which closes 1 connection) and reconnect several times
  4. click record button
  5. crash

This is an intermittent failure; the more times that step 3 is repeated, the more likely a crash is to happen.

Trace from rev dde5f958fc3f7ce3edaba3eaf952a4f0e7c4dbb6:

obs-streaming-remote.dll!ClientHandler::encryptThenSendMessage(const std::string & p) Line 359
    at C:\Users\fred\code\streaming-remote\native\Core\ClientHandler.cpp(359)
obs-streaming-remote.dll!ClientHandler::encryptThenSendMessage(const nlohmann::basic_json<std::map,std::vector,std::string,bool,__int64,unsigned __int64,double,std::allocator,nlohmann::adl_serializer> & message) Line 343
    at C:\Users\fred\code\streaming-remote\native\Core\ClientHandler.cpp(343)
obs-streaming-remote.dll!ClientHandler::outputStateChanged(const std::string & id, OutputState state) Line 292
    at C:\Users\fred\code\streaming-remote\native\Core\ClientHandler.cpp(292)
[Inline Frame] obs-streaming-remote.dll!std::_Func_class<void,std::string const &,enum OutputState>::operator()(const std::string & <_Args_1>, OutputState) Line 995
    at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\functional(995)
[Inline Frame] obs-streaming-remote.dll!Signal<std::string const &,enum OutputState>::operator()(const std::string &) Line 32
    at C:\Users\fred\code\streaming-remote\native\Core\Signal.h(32)
obs-streaming-remote.dll!OBS::frontendEventCallback(obs_frontend_event event, void * data) Line 261
    at C:\Users\fred\code\streaming-remote\native\obs\OBS.cpp(261)
fredemmott commented 3 years ago

Ultimate problem is that signal connections must be tracked and cleaned up

fredemmott commented 3 years ago

02da92815beb823ace17852dcd730f3fd5c2ac5e and 995db4245c8dcc941b7c0b7a58d1aa608599efce resolve this one

fredemmott commented 3 years ago

Fixed for OBS, not XSplit