From def5fef7fbf7fedece54d52188f75a90616599a4 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Thu, 13 Nov 2014 17:37:02 +0100 Subject: Clear a stray ref on layers when purging GL resources Fix a regression of 3df57f7e550a19cb4450ed3896aa51ddb38c2ed2 where a reference to TextureMapperBackingStore would be kept in the TextureMapperLayers after purgeGLResources(). This would crash later on if the window would get destroyed before the CoordinatedGraphicsScene that own those layers. Task-number: QTBUG-40734 Change-Id: Id1a596c0f0ba9afd1e163f83c38dda939f521314 Reviewed-by: Allan Sandfeld Jensen --- .../platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Source') diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp index acd382cdb..b9709136d 100644 --- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp +++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp @@ -694,6 +694,10 @@ void CoordinatedGraphicsScene::purgeGLResources() m_backingStores.clear(); m_backingStoresWithPendingBuffers.clear(); + LayerMap::iterator end = m_layers.end(); + for (LayerMap::iterator it = m_layers.begin(); it != end; ++it) + it->value->setBackingStore(0); + setActive(false); dispatchOnMainThread(bind(&CoordinatedGraphicsScene::purgeBackingStores, this)); } -- cgit v1.2.1