Bug 38899 - [CAIRO] Memory leak with cairo_pattern_t objects
Summary: [CAIRO] Memory leak with cairo_pattern_t objects
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-11 05:37 PDT by Andrei Bucur
Modified: 2010-05-15 12:42 PDT (History)
2 users (show)

See Also:


Attachments
First patch (4.74 KB, patch)
2010-05-11 05:45 PDT, Andrei Bucur
no flags Details | Formatted Diff | Diff
Second patch (4.56 KB, patch)
2010-05-11 06:02 PDT, Andrei Bucur
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Bucur 2010-05-11 05:37:20 PDT
There is an incomplete life cycle for cairo_pattern_t objects returned by the call Pattern::createPlatformPattern in PatternCairo.cpp.
The returned object is applied directly on the current surface without being deleted after the paint operation was executed.
This flaw can generate huge memory leaks if the pattern contains large objects (such as images).
This patch completes the life cycle of the problematic objects by calling cairo_destroy_pattern on them after the paint operation.
Comment 1 Andrei Bucur 2010-05-11 05:45:39 PDT
Created attachment 55691 [details]
First patch

Repost the patch because the first attempt failed.
Comment 2 WebKit Review Bot 2010-05-11 05:51:25 PDT
Attachment 55691 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1
WebCore/ChangeLog:6:  Line contains tab character.  [whitespace/tab] [5]
WebCore/ChangeLog:7:  Line contains tab character.  [whitespace/tab] [5]
WebCore/ChangeLog:10:  Line contains tab character.  [whitespace/tab] [5]
Total errors found: 3 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Andrei Bucur 2010-05-11 06:02:01 PDT
Created attachment 55693 [details]
Second patch

Same patch, no tabs this time.
Comment 4 Gustavo Noronha (kov) 2010-05-11 07:31:36 PDT
Comment on attachment 55693 [details]
Second patch

Makes sense to me! Thanks!
Comment 5 WebKit Commit Bot 2010-05-15 12:42:01 PDT
Comment on attachment 55693 [details]
Second patch

Clearing flags on attachment: 55693

Committed r59548: <http://trac.webkit.org/changeset/59548>
Comment 6 WebKit Commit Bot 2010-05-15 12:42:06 PDT
All reviewed patches have been landed.  Closing bug.