Call shutdown on the peer's websocket when the session to the client dies

Also, seems that calling LOKitDocument::destroy() (in the child process's
LOOLSession dtor) causes crashes, avoid that. The can be little need for any
cleanup as the process is about to exit anyway, and the user profile is a
temporary one that will be binned.
This commit is contained in:
Tor Lillqvist 2015-04-16 20:18:25 +03:00
parent 02f12402bf
commit a63f797fff

View file

@ -73,10 +73,10 @@ LOOLSession::LOOLSession(WebSocket& ws, LibreOfficeKit *loKit, UInt64 childId) :
LOOLSession::~LOOLSession()
{
std::cout << Util::logPrefix() << "LOOLSesstion dtor this=" << this << std::endl;
std::cout << Util::logPrefix() << "LOOLSesstion dtor this=" << this << " isChildProcess()=" << (isChildProcess()?"YES":"NO") << " toChildProcess()=" << (toChildProcess()?"YES":"NO") << " _peer=" << _peer << std::endl;
_ws->shutdown();
if (_loKitDocument)
_loKitDocument->pClass->destroy(_loKitDocument);
if (!isChildProcess() && !toChildProcess() && _peer != nullptr)
_peer->_ws->shutdown();
}
const std::string LOOLSession::jailDocumentURL = "/user/thedocument";