Closed Bug 726741 Opened 10 years ago Closed 10 years ago

We leak nsPluginInstanceOwner for every plugin instance on ICS

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 13

People

(Reporter: snorp, Assigned: snorp)

Details

Attachments

(1 file)

In a few ANP interfaces, we request the nsPluginInstanceOwner* via nsNPAPIPluginInstance::GetOwner. GetOwner() refs the return, but we don't explicitly unref or use nsRefPtr, and the object is leaked later when the plugin instance is destroyed.
Comment on attachment 596751 [details] [diff] [review]
Don't leak nsPluginInstanceOwner on Android

Review of attachment 596751 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/plugins/base/android/ANPVideo.cpp
@@ +42,5 @@
> +}
> +
> +static AndroidMediaLayer* GetLayerForInstance(NPP instance) {
> +  nsRefPtr<nsPluginInstanceOwner> owner;
> +  if (NS_FAILED(GetOwner(instance, getter_AddRefs(owner))))

I prefer always having braces for if blocks.
Attachment #596751 - Flags: review?(joshmoz) → review+
https://hg.mozilla.org/mozilla-central/rev/f086b7e2de8a
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 13
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.