Commit 7f759692 authored by mjs@apple.com's avatar mjs@apple.com

2008-03-27 Maciej Stachowiak <mjs@apple.com>

        Reviewed by Darin.

        - fixed many buildbot leaks in glyph map code

        * svg/SVGGlyphMap.h:
        (WebCore::GlyphMapNode::create): Use explicit create pattern, to avoid overreffing and therefore leaking
        these objects.
        (WebCore::SVGGlyphMap::add): Call create instead of using new.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0741a509
2008-03-27 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed many buildbot leaks in glyph map code
* svg/SVGGlyphMap.h:
(WebCore::GlyphMapNode::create): Use explicit create pattern, to avoid overreffing and therefore leaking
these objects.
(WebCore::SVGGlyphMap::add): Call create instead of using new.
2008-03-27 Maciej Stachowiak <mjs@apple.com>
Rubber stamped by Oliver.
......@@ -31,7 +31,10 @@ namespace WebCore {
typedef HashMap<UChar, RefPtr<GlyphMapNode> > GlyphMapLayer;
struct GlyphMapNode : public RefCounted<GlyphMapNode> {
private:
GlyphMapNode() { }
public:
PassRefPtr<GlyphMapNode> create() { return adoptRef(new GlyphMapNode); }
Vector<SVGGlyphIdentifier> glyphs;
......@@ -39,6 +42,7 @@ namespace WebCore {
};
class SVGGlyphMap {
public:
SVGGlyphMap() : m_currentPriority(0) { }
......@@ -52,7 +56,7 @@ namespace WebCore {
UChar curChar = string[i];
node = currentLayer->get(curChar);
if (!node) {
node = new GlyphMapNode;
node = GlyphMapNode::create();
currentLayer->set(curChar, node);
}
currentLayer = &node->children;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment