зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1374047
- Keep WebSocketImpl alive before calling DisconnectInternal. r=smaug
--HG-- extra : rebase_source : 89a230a93132029be40dd620ac29a6698e88790f
This commit is contained in:
Родитель
22d94d1020
Коммит
bded2d68fd
|
@ -620,6 +620,10 @@ WebSocketImpl::Disconnect()
|
|||
|
||||
AssertIsOnTargetThread();
|
||||
|
||||
// DontKeepAliveAnyMore() and DisconnectInternal() can release the object. So
|
||||
// hold a reference to this until the end of the method.
|
||||
RefPtr<WebSocketImpl> kungfuDeathGrip = this;
|
||||
|
||||
// Disconnect can be called from some control event (such as Notify() of
|
||||
// WorkerHolder). This will be schedulated before any other sync/async
|
||||
// runnable. In order to prevent some double Disconnect() calls, we use this
|
||||
|
@ -641,10 +645,6 @@ WebSocketImpl::Disconnect()
|
|||
rv.SuppressException();
|
||||
}
|
||||
|
||||
// DontKeepAliveAnyMore() can release the object. So hold a reference to this
|
||||
// until the end of the method.
|
||||
RefPtr<WebSocketImpl> kungfuDeathGrip = this;
|
||||
|
||||
NS_ReleaseOnMainThread("WebSocketImpl::mChannel", mChannel.forget());
|
||||
NS_ReleaseOnMainThread("WebSocketImpl::mService", mService.forget());
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче