[Webkit-unassigned] [Bug 50990] Unused CSSRuleList vector in CSSParser class.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 24 07:59:27 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=50990


David Levin <levin at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #76963|review?                     |review-
               Flag|                            |




--- Comment #5 from David Levin <levin at chromium.org>  2010-12-24 07:59:27 PST ---
(From update of attachment 76963)
View in context: https://bugs.webkit.org/attachment.cgi?id=76963&action=review

Overall, this feel tricky. (Leaking the pointer and then in another function in another file doing the adoptRef.)  Reinforcing this is the fact that is there is a memory leak bug which several of us missed.  (Eric missed it. I didn't see it for a while, and you missed it.)

So I'm wondering what benefit is it to remove this variable? (It looks like CSSParser is not a long lived object. It also doesn't appear that lots of them are created at the same time.)

> WebCore/css/CSSGrammar.y:415
> +          if (!$$) {

Nit: No { for single line statements.

> WebCore/css/CSSParser.cpp:5518
>      if (!media || !rules || !m_styleSheet)

The ref count on rules leaks here.

I'd suggest putting rules in a RefPtr<> = adoptRef(rules); immediately upon entering this function and then doing a .releaseRef() below.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list