зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1332233 - prevent resource leak in CustomElementRegistry::Define. r=baku
MozReview-Commit-ID: AzXgls3lKCA --HG-- extra : rebase_source : 89c5c54e0c149aa01dd576fa66402eff1ac76173
This commit is contained in:
Родитель
1305bbb18d
Коммит
a3efd41d68
|
@ -772,13 +772,6 @@ CustomElementRegistry::Define(const nsAString& aName,
|
|||
// Associate the definition with the custom element.
|
||||
nsCOMPtr<nsIAtom> localNameAtom(NS_Atomize(localName));
|
||||
LifecycleCallbacks* callbacks = callbacksHolder.forget();
|
||||
CustomElementDefinition* definition =
|
||||
new CustomElementDefinition(nameAtom,
|
||||
localNameAtom,
|
||||
constructor,
|
||||
constructorPrototype,
|
||||
callbacks,
|
||||
0 /* TODO dependent on HTML imports. Bug 877072 */);
|
||||
|
||||
/**
|
||||
* 12. Add definition to this CustomElementRegistry.
|
||||
|
@ -788,6 +781,14 @@ CustomElementRegistry::Define(const nsAString& aName,
|
|||
return;
|
||||
}
|
||||
|
||||
CustomElementDefinition* definition =
|
||||
new CustomElementDefinition(nameAtom,
|
||||
localNameAtom,
|
||||
constructor,
|
||||
constructorPrototype,
|
||||
callbacks,
|
||||
0 /* TODO dependent on HTML imports. Bug 877072 */);
|
||||
|
||||
mCustomDefinitions.Put(nameAtom, definition);
|
||||
|
||||
MOZ_ASSERT(mCustomDefinitions.Count() == mConstructors.count(),
|
||||
|
|
Загрузка…
Ссылка в новой задаче