Changeset 152232 in webkit


Ignore:
Timestamp:
Jul 1, 2013 11:04:34 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[ATK] Leak: leaks in WebKitAccessibleInterfaceText
https://bugs.webkit.org/show_bug.cgi?id=118248

Fixed memory leaks.

Patch by Brian Holt <brian.holt@samsung.com> on 2013-07-01
Reviewed by Christophe Dumez.

  • accessibility/atk/WebKitAccessibleInterfaceText.cpp:

(getPangoLayoutForAtk):
(webkitAccessibleTextGetText):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r152231 r152232  
     12013-07-01  Brian Holt  <brian.holt@samsung.com>
     2
     3        [ATK] Leak: leaks in WebKitAccessibleInterfaceText
     4        https://bugs.webkit.org/show_bug.cgi?id=118248
     5
     6        Fixed memory leaks.
     7
     8        Reviewed by Christophe Dumez.
     9
     10        * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
     11        (getPangoLayoutForAtk):
     12        (webkitAccessibleTextGetText):
     13
    1142013-07-01  Roger Fong  <roger_fong@apple.com>
    215
  • trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp

    r152095 r152232  
    9595            // children are, in order not to miss those portions of
    9696            // text by not properly handling those situations
    97             if (object->firstChild())
    98                 g_string_append(resultText, textForRenderer(object));
    99 
     97            if (object->firstChild()) {
     98                GOwnPtr<char> objectText(textForRenderer(object));
     99                g_string_append(resultText, objectText.get());
     100            }
    100101            continue;
    101102        }
     
    188189
    189190    // Create a string with the layout as it appears on the screen
    190     PangoLayout* layout = gtk_widget_create_pango_layout(static_cast<GtkWidget*>(webView), textForObject(coreObject));
     191    GOwnPtr<char> objectText(textForObject(coreObject));
     192    PangoLayout* layout = gtk_widget_create_pango_layout(static_cast<GtkWidget*>(webView), objectText.get());
    191193    return layout;
    192194}
     
    448450static IntRect textExtents(AtkText* text, gint startOffset, gint length, AtkCoordType coords)
    449451{
    450     gchar* textContent = webkitAccessibleTextGetText(text, startOffset, -1);
    451     gint textLength = g_utf8_strlen(textContent, -1);
     452    GOwnPtr<char> textContent(webkitAccessibleTextGetText(text, startOffset, -1));
     453    gint textLength = g_utf8_strlen(textContent.get(), -1);
    452454
    453455    // The first case (endOffset of -1) should work, but seems broken for all Gtk+ apps.
     
    550552        // In such instances, there may also be embedded objects. The object replacement character
    551553        // is something ATs want included and we have to account for the fact that it is multibyte.
    552         ret = String::fromUTF8(textForObject(coreObject));
     554        GOwnPtr<char> objectText(textForObject(coreObject));
     555        ret = String::fromUTF8(objectText.get());
    553556        if (!end)
    554557            end = ret.length();
Note: See TracChangeset for help on using the changeset viewer.