Closed Bug 802491 Opened 13 years ago Closed 13 years ago

ScrollbarLayer's direct-allocation buffers get leaked

Categories

(Firefox for Android Graveyard :: Toolbar, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 19

People

(Reporter: kats, Assigned: kats)

References

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
Found this while testing pushkar's patch for bug 779511. The BufferedCairoImage class doesn't accept ownership of the direct-allocation buffer passed in during construction or via the setBuffer call (i.e. it doesn't set the mNeedToFreeBuffer boolean and therefore doesn't free the buffer). However, all users of BufferedCairoImage assume that it takes ownership of the buffer, and so they don't free it either! Therefore the buffer gets leaked. Thankfully this only affects the ScrollbarLayer instances by default since TextLayer is never instantiated unless the frame rate pref is enabled, and PluginLayer passes in a null buffer. Attached patch basically makes BufferedCairoImage always accept ownership of the buffer, which removes the guesswork from the caller code and makes it behave consistently (from one point of view at least).
Attachment #672184 - Flags: review?(chrislord.net)
Comment on attachment 672184 [details] [diff] [review] Patch Review of attachment 672184 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me, I assume that all users of this class have been checked.
Attachment #672184 - Flags: review?(chrislord.net) → review+
For future reference, I had pushed this to try along with the patch from bug 802495, try run is at https://tbpl.mozilla.org/?tree=Try&rev=766f2d373c6c
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → Firefox 19
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: