Abandoned Memory: SVGFontElement and Corresponding SVGDocument Never Deconstructed
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jan 2013 19:18:22 +0000 (19:18 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jan 2013 19:18:22 +0000 (19:18 +0000)
commit8794b57a012a82147dfabd190ee43de53e032e35
treec130832a6d5b3eea22c45e7b28fc5b4c8b276912
parentbacabd0bbc8969980ebf575acd604799c63b3b8a
Abandoned Memory: SVGFontElement and Corresponding SVGDocument Never Deconstructed
https://bugs.webkit.org/show_bug.cgi?id=66438

Reviewed by Dirk Schulze.

The memory leak was caused by SVGFontFaceElement storing its own parent in a RefPtr.

Fixed the bug by storing a raw pointer instead, and clearing the pointer in removedFrom
when the node detached from the document. Also added several sanity check assertions.

* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::SVGFontFaceElement):
(WebCore::SVGFontFaceElement::associatedFontElement):
(WebCore::SVGFontFaceElement::rebuildFontFace):
(WebCore::SVGFontFaceElement::insertedInto):
(WebCore::SVGFontFaceElement::removedFrom):
* svg/SVGFontFaceElement.h:
(SVGFontFaceElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@140698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/svg/SVGFontFaceElement.cpp
Source/WebCore/svg/SVGFontFaceElement.h