summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-11-27 18:44:08 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-02 13:10:39 +0100
commita3b20f87c4791ab294f770fb9f1b6a6a42349da8 (patch)
tree6c66b7627c71b1fe8505e1b665d4bf3094ad3b1d
parent48c1382c33b77b002c1b295b9d2d6c4987526add (diff)
Fix crash on exit of Google Maps
QtWebKit may crash when exiting the new WebGL version of Google maps. The problem is that under some circumstances the PlatformLayer is destroyed before the GraphicsLayer that reference it, causing the GraphicsLayer to access it during destruction. Change-Id: Ia3d0f337dcb9b8b38e9e23f53bea669bd868f713 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
-rw-r--r--Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp4
-rw-r--r--Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h2
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h1
3 files changed, 7 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
index 1c7289cec..9824eb55f 100644
--- a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
@@ -221,6 +221,10 @@ void GraphicsContext3DPrivate::initializeANGLE()
GraphicsContext3DPrivate::~GraphicsContext3DPrivate()
{
+#if USE(ACCELERATED_COMPOSITING)
+ if (TextureMapperPlatformLayer::Client* client = TextureMapperPlatformLayer::client())
+ client->platformLayerWasDestroyed();
+#endif
delete m_surfaceOwner;
m_surfaceOwner = 0;
}
diff --git a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
index 61ddfb92a..16e4ebad0 100644
--- a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
+++ b/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
@@ -112,7 +112,9 @@ private:
void prepareBackingStoreIfNeeded();
bool shouldHaveBackingStore() const;
+ // TextureMapperPlatformLayer::Client methods:
virtual void setPlatformLayerNeedsDisplay() OVERRIDE { setContentsNeedsDisplay(); }
+ virtual void platformLayerWasDestroyed() OVERRIDE { m_contentsLayer = 0; }
// This set of flags help us defer which properties of the layer have been
// modified by the compositor, so we can know what to look for in the next flush.
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h b/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h
index 0cab98da4..e0888766a 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h
@@ -34,6 +34,7 @@ public:
class Client {
public:
virtual void setPlatformLayerNeedsDisplay() = 0;
+ virtual void platformLayerWasDestroyed() = 0;
};
TextureMapperPlatformLayer() : m_client(0) { }