Title: [152232] trunk/Source/WebCore
- Revision
- 152232
- Author
- [email protected]
- Date
- 2013-07-01 11:04:34 -0700 (Mon, 01 Jul 2013)
Log Message
[ATK] Leak: leaks in WebKitAccessibleInterfaceText
https://bugs.webkit.org/show_bug.cgi?id=118248
Fixed memory leaks.
Patch by Brian Holt <[email protected]> on 2013-07-01
Reviewed by Christophe Dumez.
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(getPangoLayoutForAtk):
(webkitAccessibleTextGetText):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (152231 => 152232)
--- trunk/Source/WebCore/ChangeLog 2013-07-01 17:53:38 UTC (rev 152231)
+++ trunk/Source/WebCore/ChangeLog 2013-07-01 18:04:34 UTC (rev 152232)
@@ -1,3 +1,16 @@
+2013-07-01 Brian Holt <[email protected]>
+
+ [ATK] Leak: leaks in WebKitAccessibleInterfaceText
+ https://bugs.webkit.org/show_bug.cgi?id=118248
+
+ Fixed memory leaks.
+
+ Reviewed by Christophe Dumez.
+
+ * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
+ (getPangoLayoutForAtk):
+ (webkitAccessibleTextGetText):
+
2013-07-01 Roger Fong <[email protected]>
Unreviewed. Make WebCore.make copy over QTMovieWin DLL's and PDB's.
Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp (152231 => 152232)
--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp 2013-07-01 17:53:38 UTC (rev 152231)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp 2013-07-01 18:04:34 UTC (rev 152232)
@@ -94,9 +94,10 @@
// current object is not a text object but some of its
// children are, in order not to miss those portions of
// text by not properly handling those situations
- if (object->firstChild())
- g_string_append(resultText, textForRenderer(object));
-
+ if (object->firstChild()) {
+ GOwnPtr<char> objectText(textForRenderer(object));
+ g_string_append(resultText, objectText.get());
+ }
continue;
}
@@ -187,7 +188,8 @@
return 0;
// Create a string with the layout as it appears on the screen
- PangoLayout* layout = gtk_widget_create_pango_layout(static_cast<GtkWidget*>(webView), textForObject(coreObject));
+ GOwnPtr<char> objectText(textForObject(coreObject));
+ PangoLayout* layout = gtk_widget_create_pango_layout(static_cast<GtkWidget*>(webView), objectText.get());
return layout;
}
#endif
@@ -447,8 +449,8 @@
static IntRect textExtents(AtkText* text, gint startOffset, gint length, AtkCoordType coords)
{
- gchar* textContent = webkitAccessibleTextGetText(text, startOffset, -1);
- gint textLength = g_utf8_strlen(textContent, -1);
+ GOwnPtr<char> textContent(webkitAccessibleTextGetText(text, startOffset, -1));
+ gint textLength = g_utf8_strlen(textContent.get(), -1);
// The first case (endOffset of -1) should work, but seems broken for all Gtk+ apps.
gint rangeLength = length;
@@ -549,7 +551,8 @@
// This can happen at least with anonymous RenderBlocks (e.g. body text amongst paragraphs)
// In such instances, there may also be embedded objects. The object replacement character
// is something ATs want included and we have to account for the fact that it is multibyte.
- ret = String::fromUTF8(textForObject(coreObject));
+ GOwnPtr<char> objectText(textForObject(coreObject));
+ ret = String::fromUTF8(objectText.get());
if (!end)
end = ret.length();
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes