1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-27 09:41:46 +00:00

Issue #1691 - Part 11: Fix incorrect reference counting in ModuleScript class.

(cherry picked from commit 4ef1fa98c9518f5c107424667229ddb6f9f97767)
This commit is contained in:
Brian Smith
2023-04-22 03:57:28 -05:00
committed by roytam1
parent 7e056a6f72
commit edb82ec9f2
+2 -1
View File
@@ -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