<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>37500</bug_id>
          
          <creation_ts>2010-04-13 07:01:44 -0700</creation_ts>
          <short_desc>[Gtk] Fix leaking the FontPlatformData instance used to create the the small caps font data.</short_desc>
          <delta_ts>2010-05-03 09:57:06 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Platform</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Other</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Stephan Aßmus">superstippi</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>zecke</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>211930</commentid>
    <comment_count>0</comment_count>
    <who name="Stephan Aßmus">superstippi</who>
    <bug_when>2010-04-13 07:01:44 -0700</bug_when>
    <thetext>WebCore::SimpleFontData::smallCapsFontData() is allocating a FontPlatformData object on the heap and assigns it to a const pointer and never frees it. The FontPlatformData is used for assigning the member of the same type in a SimpleFontData object. Usually, ports implement the data of FontPlatformData to be reference counted, and the instance in SimpleFontData takes over the ownership (same in the Gtk port). The Haiku port contained the same problem initially, that&apos;s why I spotted it when cross referencing the Gtk port.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>211931</commentid>
    <comment_count>1</comment_count>
      <attachid>53243</attachid>
    <who name="Stephan Aßmus">superstippi</who>
    <bug_when>2010-04-13 07:04:01 -0700</bug_when>
    <thetext>Created attachment 53243
Patch to fix the problem</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220103</commentid>
    <comment_count>2</comment_count>
      <attachid>53243</attachid>
    <who name="Holger Freyther">zecke</who>
    <bug_when>2010-05-03 07:49:04 -0700</bug_when>
    <thetext>Comment on attachment 53243
Patch to fix the problem

&gt; Index: WebCore/ChangeLog
&gt; ===================================================================
&gt; --- WebCore/ChangeLog	(revision 57513)
&gt; +++ WebCore/ChangeLog	(working copy)
&gt; @@ -1,3 +1,18 @@
&gt; +2010-04-13  Stephan AÃmus  &lt;superstippi@gmx.de&gt;
&gt; +
&gt; +        Reviewed by NOBODY (OOPS!).
&gt; +
&gt; +        [Gtk] Fix leaking the FontPlatformData instance used to create the the
&gt; +        small caps font data.
&gt; +        https://bugs.webkit.org/show_bug.cgi?id=37500
&gt; +
&gt; +        No new tests needed.
&gt; +
&gt; +        * platform/graphics/gtk/SimpleFontDataPango.cpp:
&gt; +        (WebCore::SimpleFontData::smallCapsFontData):
&gt; +            - Use a stack allocated FontPlatformData instead of a heap allocated
&gt; +              one that is never freed.

Thanks a lot!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220105</commentid>
    <comment_count>3</comment_count>
    <who name="Holger Freyther">zecke</who>
    <bug_when>2010-05-03 07:57:28 -0700</bug_when>
    <thetext> git grep &quot;const FontPlatformData\* pdata = new&quot; WebCore/platform/graphics/
WebCore/platform/graphics/cairo/SimpleFontDataCairo.cpp:        const FontPlatfo
WebCore/platform/graphics/gtk/SimpleFontDataPango.cpp:        const FontPlatform
WebCore/platform/graphics/wx/SimpleFontDataWx.cpp: 

so, we need to fix these two as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220149</commentid>
    <comment_count>4</comment_count>
      <attachid>53243</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-05-03 09:57:02 -0700</bug_when>
    <thetext>Comment on attachment 53243
Patch to fix the problem

Clearing flags on attachment: 53243

Committed r58679: &lt;http://trac.webkit.org/changeset/58679&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220150</commentid>
    <comment_count>5</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-05-03 09:57:06 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>53243</attachid>
            <date>2010-04-13 07:04:01 -0700</date>
            <delta_ts>2010-05-03 09:57:01 -0700</delta_ts>
            <desc>Patch to fix the problem</desc>
            <filename>SimpleFontDataPango.diff</filename>
            <type>text/plain</type>
            <size>1710</size>
            <attacher name="Stephan Aßmus">superstippi</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA1NzUxMykKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTggQEAKKzIwMTAtMDQtMTMgIFN0ZXBoYW4gQcOfbXVzICA8c3VwZXJzdGlwcGlA
Z214LmRlPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAg
IFtHdGtdIEZpeCBsZWFraW5nIHRoZSBGb250UGxhdGZvcm1EYXRhIGluc3RhbmNlIHVzZWQgdG8g
Y3JlYXRlIHRoZSB0aGUKKyAgICAgICAgc21hbGwgY2FwcyBmb250IGRhdGEuCisgICAgICAgIGh0
dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0zNzUwMAorCisgICA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lc2NyaXB0aW9uLmNvbXB1dGVkU2l6ZSgpKTsKLSAg
ICAgICAgY29uc3QgRm9udFBsYXRmb3JtRGF0YSogcGRhdGEgPSBuZXcgRm9udFBsYXRmb3JtRGF0
YShkZXNjLCBkZXNjLmZhbWlseSgpLmZhbWlseSgpKTsKLSAgICAgICAgbV9zbWFsbENhcHNGb250
RGF0YSA9IG5ldyBTaW1wbGVGb250RGF0YSgqcGRhdGEpOworICAgICAgICBkZXNjLnNldFNwZWNp
ZmllZFNpemUoMC43MGYgKiBmb250RGVzY3JpcHRpb24uY29tcHV0ZWRTaXplKCkpOworICAgICAg
ICBGb250UGxhdGZvcm1EYXRhIHBsYXRmb3JtRGF0YShkZXNjLCBkZXNjLmZhbWlseSgpLmZhbWls
eSgpKTsKKyAgICAgICAgbV9zbWFsbENhcHNGb250RGF0YSA9IG5ldyBTaW1wbGVGb250RGF0YShw
bGF0Zm9ybURhdGEpOwogICAgIH0KICAgICByZXR1cm4gbV9zbWFsbENhcHNGb250RGF0YTsKIH0K
</data>

          </attachment>
      

    </bug>

</bugzilla>