mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-17 04:37:46 +09:00
WebSocketChannel::CleanupConnection should run on the socket thread
This commit is contained in:
parent
37f0199c79
commit
7fab5ebd11
1 changed files with 10 additions and 0 deletions
|
|
@ -2313,6 +2313,16 @@ WebSocketChannel::CleanupConnection()
|
||||||
{
|
{
|
||||||
LOG(("WebSocketChannel::CleanupConnection() %p", this));
|
LOG(("WebSocketChannel::CleanupConnection() %p", this));
|
||||||
|
|
||||||
|
// This should run on the Socket Thread to prevent potential races.
|
||||||
|
bool onSocketThread;
|
||||||
|
nsresult rv = mSocketThread->IsOnCurrentThread(&onSocketThread);
|
||||||
|
if (NS_SUCCEEDED(rv) && !onSocketThread) {
|
||||||
|
mSocketThread->Dispatch(
|
||||||
|
NewRunnableMethod(this, &WebSocketChannel::CleanupConnection),
|
||||||
|
NS_DISPATCH_NORMAL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (mLingeringCloseTimer) {
|
if (mLingeringCloseTimer) {
|
||||||
mLingeringCloseTimer->Cancel();
|
mLingeringCloseTimer->Cancel();
|
||||||
mLingeringCloseTimer = nullptr;
|
mLingeringCloseTimer = nullptr;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue