This patch dramatically reduces the memory consumed by animated images. ...
[WebKit-https.git] / WebCore / platform / graphics / cg / ImageSourceCG.cpp
index 681e576..c33303a 100644 (file)
@@ -40,8 +40,15 @@ ImageSource::ImageSource()
 
 ImageSource::~ImageSource()
 {
-    if (m_decoder)
+    clear();
+}
+
+void ImageSource::clear()
+{
+    if (m_decoder) {
         CFRelease(m_decoder);
+        m_decoder = 0;
+    }
 }
 
 const CFStringRef kCGImageSourceShouldPreferRGB32 = CFSTR("kCGImageSourceShouldPreferRGB32");