Fixes <http://webkit.org/b/39466> <rdar://problem/
8007141>.
Reviewed by Simon Fraser.
* platform/graphics/win/WKCACFContextFlusher.cpp:
(WebCore::WKCACFContextFlusher::addContext): Only retain the context
when we first add it to the m_contexts set. Otherwise we'll retain the
same context multiple times, causing it to leak.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@59897
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2010-05-20 Adam Roben <aroben@apple.com>
+
+ Stop leaking all CACFContexts
+
+ Fixes <http://webkit.org/b/39466> <rdar://problem/8007141>.
+
+ Reviewed by Simon Fraser.
+
+ * platform/graphics/win/WKCACFContextFlusher.cpp:
+ (WebCore::WKCACFContextFlusher::addContext): Only retain the context
+ when we first add it to the m_contexts set. Otherwise we'll retain the
+ same context multiple times, causing it to leak.
+
2010-05-20 Young Han Lee <joybro@company100.net>
Reviewed by Darin Adler.
{
ASSERT(context);
- m_contexts.add(context);
- CFRetain(context);
+ if (m_contexts.add(context).second)
+ CFRetain(context);
}
void WKCACFContextFlusher::removeContext(CACFContextRef context)