mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-04 14:27:30 +09:00
Bug 1332233 - prevent resource leak in CustomElementRegistry::Define.
Tag UXP Issue #1344
This commit is contained in:
parent
2bd8be69ea
commit
6f325a61af
1 changed files with 9 additions and 8 deletions
|
|
@ -817,14 +817,6 @@ CustomElementRegistry::Define(const nsAString& aName,
|
||||||
// Associate the definition with the custom element.
|
// Associate the definition with the custom element.
|
||||||
nsCOMPtr<nsIAtom> localNameAtom(NS_Atomize(localName));
|
nsCOMPtr<nsIAtom> localNameAtom(NS_Atomize(localName));
|
||||||
LifecycleCallbacks* callbacks = callbacksHolder.forget();
|
LifecycleCallbacks* callbacks = callbacksHolder.forget();
|
||||||
CustomElementDefinition* definition =
|
|
||||||
new CustomElementDefinition(nameAtom,
|
|
||||||
localNameAtom,
|
|
||||||
&aFunctionConstructor,
|
|
||||||
Move(observedAttributes),
|
|
||||||
constructorPrototype,
|
|
||||||
callbacks,
|
|
||||||
0 /* TODO dependent on HTML imports. Bug 877072 */);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 12. Add definition to this CustomElementRegistry.
|
* 12. Add definition to this CustomElementRegistry.
|
||||||
|
|
@ -834,6 +826,15 @@ CustomElementRegistry::Define(const nsAString& aName,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CustomElementDefinition* definition =
|
||||||
|
new CustomElementDefinition(nameAtom,
|
||||||
|
localNameAtom,
|
||||||
|
&aFunctionConstructor,
|
||||||
|
Move(observedAttributes),
|
||||||
|
constructorPrototype,
|
||||||
|
callbacks,
|
||||||
|
0 /* TODO dependent on HTML imports. Bug 877072 */);
|
||||||
|
|
||||||
mCustomDefinitions.Put(nameAtom, definition);
|
mCustomDefinitions.Put(nameAtom, definition);
|
||||||
|
|
||||||
MOZ_ASSERT(mCustomDefinitions.Count() == mConstructors.count(),
|
MOZ_ASSERT(mCustomDefinitions.Count() == mConstructors.count(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue