зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1141081: Ensure nsPluginInstanceOwner::Destroy is called before returning from failed plugin instantiation; r=jimm
--HG-- extra : rebase_source : 066ea5acbfdb2df1976fa12675cc267d1f417564
This commit is contained in:
Родитель
c64dbd1ed9
Коммит
081c02fb8a
|
@ -811,17 +811,20 @@ nsPluginHost::InstantiatePluginInstance(const nsACString& aMimeType, nsIURI* aUR
|
|||
nsPluginTagType tagType;
|
||||
rv = instanceOwner->GetTagType(&tagType);
|
||||
if (NS_FAILED(rv)) {
|
||||
instanceOwner->Destroy();
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (tagType != nsPluginTagType_Embed &&
|
||||
tagType != nsPluginTagType_Applet &&
|
||||
tagType != nsPluginTagType_Object) {
|
||||
instanceOwner->Destroy();
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
rv = SetUpPluginInstance(aMimeType, aURL, instanceOwner);
|
||||
if (NS_FAILED(rv)) {
|
||||
instanceOwner->Destroy();
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
const bool isAsyncInit = (rv == NS_PLUGIN_INIT_PENDING);
|
||||
|
@ -829,6 +832,7 @@ nsPluginHost::InstantiatePluginInstance(const nsACString& aMimeType, nsIURI* aUR
|
|||
nsRefPtr<nsNPAPIPluginInstance> instance;
|
||||
rv = instanceOwner->GetInstance(getter_AddRefs(instance));
|
||||
if (NS_FAILED(rv)) {
|
||||
instanceOwner->Destroy();
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче