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
+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.
typedef HashMap<UChar, RefPtr<GlyphMapNode> > GlyphMapLayer;
struct GlyphMapNode : public RefCounted<GlyphMapNode> {
+ private:
GlyphMapNode() { }
+ public:
+ PassRefPtr<GlyphMapNode> create() { return adoptRef(new GlyphMapNode); }
Vector<SVGGlyphIdentifier> glyphs;
};
class SVGGlyphMap {
+
public:
SVGGlyphMap() : m_currentPriority(0) { }
UChar curChar = string[i];
node = currentLayer->get(curChar);
if (!node) {
- node = new GlyphMapNode;
+ node = GlyphMapNode::create();
currentLayer->set(curChar, node);
}
currentLayer = &node->children;