diff --git a/net/Socket.cpp b/net/Socket.cpp index 5faeced70..652c7568b 100644 --- a/net/Socket.cpp +++ b/net/Socket.cpp @@ -128,7 +128,11 @@ void SocketDisposition::execute() // We should have hard ownership of this socket. assert(_socket->getThreadOwner() == std::this_thread::get_id()); if (_socketMove) + { + // Drop pretentions of ownership before _socketMove. + _socket->setThreadOwner(std::thread::id(0)); _socketMove(_socket); + } _socketMove = nullptr; } diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp index a67719967..ce9836513 100644 --- a/wsd/LOOLWSD.cpp +++ b/wsd/LOOLWSD.cpp @@ -1485,7 +1485,6 @@ private: // until we attach the childProcess (with this socket) // to a docBroker, which will do the polling. disposition.setMove([child](const std::shared_ptr &){ - // Drop pretentions of ownership before adding to the list. addNewChild(child); }); }