mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 23:27:30 +09:00
Issue #1691 - Part 11: Fix incorrect reference counting in ModuleScript class.
(cherry picked from commit 4ef1fa98c9518f5c107424667229ddb6f9f97767)
This commit is contained in:
parent
7e056a6f72
commit
edb82ec9f2
1 changed files with 2 additions and 1 deletions
|
|
@ -132,6 +132,7 @@ ModuleScript::UnlinkModuleRecord()
|
||||||
this);
|
this);
|
||||||
JS::SetModulePrivate(mModuleRecord, JS::UndefinedValue());
|
JS::SetModulePrivate(mModuleRecord, JS::UndefinedValue());
|
||||||
mModuleRecord = nullptr;
|
mModuleRecord = nullptr;
|
||||||
|
Release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -156,6 +157,7 @@ ModuleScript::SetModuleRecord(JS::Handle<JSObject*> aModuleRecord)
|
||||||
MOZ_ASSERT(JS::GetModulePrivate(mModuleRecord).isUndefined());
|
MOZ_ASSERT(JS::GetModulePrivate(mModuleRecord).isUndefined());
|
||||||
JS::SetModulePrivate(mModuleRecord, JS::PrivateValue(this));
|
JS::SetModulePrivate(mModuleRecord, JS::PrivateValue(this));
|
||||||
HoldJSObjects(this);
|
HoldJSObjects(this);
|
||||||
|
AddRef();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -168,7 +170,6 @@ ModuleScript::SetParseError(const JS::Value& aError)
|
||||||
UnlinkModuleRecord();
|
UnlinkModuleRecord();
|
||||||
mParseError = aError;
|
mParseError = aError;
|
||||||
HoldJSObjects(this);
|
HoldJSObjects(this);
|
||||||
AddRef();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue