Closed Bug 852163 Opened 8 years ago Closed 8 years ago

GeckoApp is leaked with Don't keep activities

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 22

People

(Reporter: kats, Assigned: kats)

References

Details

Attachments

(1 file)

When "Don't keep activities" is set (and/or when GeckoApp is killed and recreated), it gets leaked from here:

Static reference from org.mozilla.gecko.PrefsHelper.sCallbacks (from class org.mozilla.gecko.PrefsHelper) :
--> java.util.HashMap@0x41554458 (48 bytes) (field table:)
--> java.util.HashMap$HashMapEntry[]@0x41581c10 (40 bytes) (Element 6 of java.util.HashMap$HashMapEntry[]@0x41581c10:)
--> java.util.HashMap$HashMapEntry@0x415830a0 (24 bytes) (field value:)
--> org.mozilla.gecko.BrowserApp$7@0x415d0a98 (12 bytes) (field this$0:)
--> org.mozilla.fennec_kats.App@0x415c5300 (329 bytes)

It looks like the "isObserver()" on the prefs helper callback means it never gets unregistered and hangs on to the enclosing Activity class.
Attached patch PatchSplinter Review
I used an Integer instead of an int just to try and keep the actual value of the id more opaque (i.e. it is allowed to be negative and we still handle it just fine).
Attachment #726194 - Flags: review?(chrislord.net)
Comment on attachment 726194 [details] [diff] [review]
Patch

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

LGTM.
Attachment #726194 - Flags: review?(chrislord.net) → review+
https://hg.mozilla.org/mozilla-central/rev/22d16e3d3ea1
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.