summaryrefslogtreecommitdiff
path: root/dom/script
diff options
context:
space:
mode:
authorBrian Smith <brian@dbsoft.org>2023-04-22 03:57:28 -0500
committerBrian Smith <brian@dbsoft.org>2023-04-27 13:35:14 -0500
commit7b42bc809de8cd925f413f39d5248c765bd56c43 (patch)
tree2703c3a1366e19877be4e85e1337b51ee6b8490a /dom/script
parent22d254b4797eba381a0bfbb85903bf653c7fa9ea (diff)
downloaduxp-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.cpp3
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