diff options
author | Brian Smith <brian@dbsoft.org> | 2023-04-22 03:57:28 -0500 |
---|---|---|
committer | Brian Smith <brian@dbsoft.org> | 2023-04-27 13:35:14 -0500 |
commit | 7b42bc809de8cd925f413f39d5248c765bd56c43 (patch) | |
tree | 2703c3a1366e19877be4e85e1337b51ee6b8490a /dom/script | |
parent | 22d254b4797eba381a0bfbb85903bf653c7fa9ea (diff) | |
download | uxp-7b42bc809de8cd925f413f39d5248c765bd56c43.tar.gz |
Issue #1691 - Part 11: Fix incorrect reference counting in ModuleScript class.
(cherry picked from commit 4ef1fa98c9518f5c107424667229ddb6f9f97767)
Diffstat (limited to 'dom/script')
-rw-r--r-- | dom/script/ModuleScript.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/dom/script/ModuleScript.cpp b/dom/script/ModuleScript.cpp index 8004ede3c6..425da8207a 100644 --- a/dom/script/ModuleScript.cpp +++ b/dom/script/ModuleScript.cpp @@ -132,6 +132,7 @@ ModuleScript::UnlinkModuleRecord() this); JS::SetModulePrivate(mModuleRecord, JS::UndefinedValue()); mModuleRecord = nullptr; + Release(); } } @@ -156,6 +157,7 @@ ModuleScript::SetModuleRecord(JS::Handle<JSObject*> aModuleRecord) MOZ_ASSERT(JS::GetModulePrivate(mModuleRecord).isUndefined()); JS::SetModulePrivate(mModuleRecord, JS::PrivateValue(this)); HoldJSObjects(this); + AddRef(); } void @@ -168,7 +170,6 @@ ModuleScript::SetParseError(const JS::Value& aError) UnlinkModuleRecord(); mParseError = aError; HoldJSObjects(this); - AddRef(); } void |