Possible dangling CachedResourceClient of StyleRuleImport and XSLImportRule
https://bugs.webkit.org/show_bug.cgi?id=120479
Patch by Leo Yang <leoyang@blackberry.com> on 2013-08-30
Reviewed by Darin Adler.
In StyleRuleImport::requestStyleSheet() and XSLImportRule::loadSheet() we
didn't call removeClient() for m_cachedSheet before assigning m_cachedSheet
a new value. This could leave the client as a client of the old cached
sheet and dangling after the client is deleted. Fix them by calling removeClient()
before assigning m_cacheSheet a new value.
Found by code inspection. Seems no way to test it automatically.
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::requestStyleSheet):
* xml/XSLImportRule.cpp:
(WebCore::XSLImportRule::loadSheet):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154889
268f45cc-cd09-0410-ab3c-
d52691b4dbfc