diff options
author | asvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-23 21:17:30 +0000 |
---|---|---|
committer | asvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-23 21:17:30 +0000 |
commit | 7e7a004713c446d6b888f75901f73176a0282982 (patch) | |
tree | 8728238851f449943cc617f2045a1c678e8973f2 /ui/gfx/render_text_mac.h | |
parent | 65a78cbf36f6fd634edecfcd8439e171135eec18 (diff) | |
download | chromium_src-7e7a004713c446d6b888f75901f73176a0282982.zip chromium_src-7e7a004713c446d6b888f75901f73176a0282982.tar.gz chromium_src-7e7a004713c446d6b888f75901f73176a0282982.tar.bz2 |
Fix memory leaks in RenderTextMac.
This addresses a TODO from http://crrev.com/147862 to
not leak CFAttributedString attributes and additionally
ensures that the CTFontRef is properly disposed.
Also renames SkColorToCGColorRef() to CGColorCreateFromSkColor()
to be clear that it follows the Create rule.
BUG=125664
TEST=No leaks on waterfall.
Review URL: https://chromiumcodereview.appspot.com/10808084
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147948 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/render_text_mac.h')
-rw-r--r-- | ui/gfx/render_text_mac.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/gfx/render_text_mac.h b/ui/gfx/render_text_mac.h index ccd9c75..1d558ad 100644 --- a/ui/gfx/render_text_mac.h +++ b/ui/gfx/render_text_mac.h @@ -75,6 +75,10 @@ class RenderTextMac : public RenderText { // The Core Text line of text. Created by |EnsureLayout()|. base::mac::ScopedCFTypeRef<CTLineRef> line_; + // Array to hold CFAttributedString attributes that allows Core Text to hold + // weak references to them without leaking. + base::mac::ScopedCFTypeRef<CFMutableArrayRef> attributes_; + // Visual dimensions of the text. Computed by |EnsureLayout()|. Size string_size_; |