mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 06:48:38 +09:00
[DOM] Improve MessagePort state machine.
This commit is contained in:
parent
d55111c4fd
commit
114daae894
1 changed files with 6 additions and 0 deletions
|
|
@ -296,6 +296,11 @@ MessagePort::MessagePort(nsIGlobalObject* aGlobal)
|
|||
MessagePort::~MessagePort()
|
||||
{
|
||||
CloseForced();
|
||||
MOZ_ASSERT(!mActor);
|
||||
if (mActor) {
|
||||
mActor->SetPort(nullptr);
|
||||
mActor = nullptr;
|
||||
}
|
||||
MOZ_ASSERT(!mWorkerHolder);
|
||||
}
|
||||
|
||||
|
|
@ -370,6 +375,7 @@ MessagePort::Initialize(const nsID& aUUID,
|
|||
|
||||
nsAutoPtr<WorkerHolder> workerHolder(new MessagePortWorkerHolder(this));
|
||||
if (NS_WARN_IF(!workerHolder->HoldWorker(workerPrivate, Closing))) {
|
||||
CloseForced();
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue