mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 15:26:07 +00:00

I think the root cause of the crash is that WebSocketImpl is not deleted on the target thread. When this happens, there is a race between setting WebSocket::mImpl to nullptr and accessubg mImpl. If WebSocketImpl is always deleted on the target thread, WebSocketImpl::Disconnect should be called in ~WebSocketImpl when mDisconnectingOrDisconnected is false. So, this patch checks the ref counter in WebSocketImpl::Release and make sure to delete WebSocketImpl on the right thread. Differential Revision: https://phabricator.services.mozilla.com/D34320 --HG-- extra : moz-landing-system : lando