Remove contexts from WKCACFContextFlusher before destroying them
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jan 2011 01:45:14 +0000 (01:45 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jan 2011 01:45:14 +0000 (01:45 +0000)
We aren't really using WKCACFContextFlusher for anything useful at the
moment, but that will probably change in the near future.

I couldn't come up with a way to test this because it isn't possible to
resize a window in DumpRenderTree.

Fixes <http://webkit.org/b/52573> REGRESSION (r75262): Crash beneath
WKCACFContextFlusher::flushAllContexts when resizing window on page
that uses accelerated compositing

Reviewed by Simon Fraser.

* platform/graphics/win/WKCACFLayerRenderer.cpp:
(WebCore::WKCACFLayerRenderer::~WKCACFLayerRenderer): Remove our
context from WKCACFContextFlusher. (This code was erroneously removed
from WKCACFLayerRenderer::destroyRenderer in r75262. This is a more
sensible place for it.)

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@75986 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp

index d71a309587a0fc8fed69aeca8f1feb119ff516d8..db5846d1a14b556670ad3fb758d584743da45d58 100644 (file)
@@ -1,3 +1,25 @@
+2011-01-17  Adam Roben  <aroben@apple.com>
+
+        Remove contexts from WKCACFContextFlusher before destroying them
+
+        We aren't really using WKCACFContextFlusher for anything useful at the
+        moment, but that will probably change in the near future.
+
+        I couldn't come up with a way to test this because it isn't possible to
+        resize a window in DumpRenderTree.
+
+        Fixes <http://webkit.org/b/52573> REGRESSION (r75262): Crash beneath
+        WKCACFContextFlusher::flushAllContexts when resizing window on page
+        that uses accelerated compositing
+
+        Reviewed by Simon Fraser.
+
+        * platform/graphics/win/WKCACFLayerRenderer.cpp:
+        (WebCore::WKCACFLayerRenderer::~WKCACFLayerRenderer): Remove our
+        context from WKCACFContextFlusher. (This code was erroneously removed
+        from WKCACFLayerRenderer::destroyRenderer in r75262. This is a more
+        sensible place for it.)
+
 2011-01-17  Adam Roben  <aroben@apple.com>
 
         Don't access the CACFLayerRef's sublayers directly from PlatformCALayer
index 4c5e61d1e0757966460e787b84e98eb00dd54faf..4d77fbdeaacfee4e3f755c0b9e665f044ea934f3 100644 (file)
@@ -225,6 +225,7 @@ WKCACFLayerRenderer::WKCACFLayerRenderer(WKCACFLayerRendererClient* client)
 WKCACFLayerRenderer::~WKCACFLayerRenderer()
 {
     destroyRenderer();
+    WKCACFContextFlusher::shared().removeContext(m_context);
     wkCACFContextDestroy(m_context);
 }