The default bug view has changed. See this FAQ.

Under certain conditions the top sites thumbnails leak database cursors

RESOLVED FIXED in Firefox 25

Status

()

Firefox for Android
Awesomescreen
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: ckitching, Assigned: ckitching)

Tracking

(Blocks: 1 bug)

Trunk
Firefox 25
ARM
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

4 years ago
Starting with an Awesomescreen with one or more gaps in the top sites display (That is, you have not yet visited enough sites for Fennec to have images to display in all the slots), tap on such a slot to add a site there. If you select a site for which a thumbnail is not available, the database Cursor goes out of scope without having close() called on it, creating a memory leak.
The culprit seems to be an if statement in TopSitesView, around line 650, which causes the function to return early without closing the Cursor.
(Assignee)

Comment 1

4 years ago
Created attachment 768615 [details] [diff] [review]
Fix for the Cursor leak described

The fix!
Assignee: nobody → ckitching
Attachment #768615 - Flags: review?(bnicholson)
Comment on attachment 768615 [details] [diff] [review]
Fix for the Cursor leak described

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

Nice find!

::: mobile/android/base/widget/TopSitesView.java
@@ +662,5 @@
> +                                    bitmap = BitmapUtils.decodeByteArray(b);
> +                                }
> +                            }
> +                        } finally {
> +                            if(c != null) {

Nit: space before "("
Attachment #768615 - Flags: review?(bnicholson) → review+
Blocks: 760394
(Assignee)

Comment 3

4 years ago
Created attachment 769769 [details] [diff] [review]
Bug 888053 - Fix cursor leak in TopSitesView r=bnicholson

Nit-picked.
Attachment #768615 - Attachment is obsolete: true
(Assignee)

Updated

4 years ago
Attachment #769769 - Attachment description: Fix for the described cursor leak, plus fix for style nit. → Bug 888053 - Fix cursor leak in TopSitesView r=bnicholson
Attachment #769769 - Flags: review?(bnicholson)
Attachment #769769 - Flags: review?(bnicholson) → review+
(Assignee)

Updated

4 years ago
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/982d07833360
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/982d07833360
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 25

Comment 6

4 years ago
Bug 760384 which depends on this bug is tracked for 23.0.
You need to log in before you can comment on or make changes to this bug.