[GTK] Crash in WebCore::CoordinatedGraphicsLayer::notifyFlushRequired
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Mar 2017 11:44:41 +0000 (11:44 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Mar 2017 11:44:41 +0000 (11:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=166420

Reviewed by Žan Doberšek.

This is happening when closing a page that is being inspected. When CoordinatedGraphicsLayer::removeFromParent()
is called, the coordinator has already been invalidated, so all its layers were set a nullptr coordinator. I
think it's safe to simply handle m_coordinator being nullptr in notifyFlushRequired().

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::notifyFlushRequired): Return early if the coordinator is nullptr.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp

index 0e0c4ef..b9d8168 100644 (file)
@@ -1,3 +1,17 @@
+2017-03-02  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Crash in WebCore::CoordinatedGraphicsLayer::notifyFlushRequired
+        https://bugs.webkit.org/show_bug.cgi?id=166420
+
+        Reviewed by Žan Doberšek.
+
+        This is happening when closing a page that is being inspected. When CoordinatedGraphicsLayer::removeFromParent()
+        is called, the coordinator has already been invalidated, so all its layers were set a nullptr coordinator. I
+        think it's safe to simply handle m_coordinator being nullptr in notifyFlushRequired().
+
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::notifyFlushRequired): Return early if the coordinator is nullptr.
+
 2017-03-02  Andreas Kling  <akling@apple.com>
 
         Don't keep dead resources in MemoryCache while under memory pressure.
index 255e7bb..5cc0be3 100644 (file)
@@ -53,7 +53,9 @@ static CoordinatedLayerID toCoordinatedLayerID(GraphicsLayer* layer)
 
 void CoordinatedGraphicsLayer::notifyFlushRequired()
 {
-    ASSERT(m_coordinator);
+    if (!m_coordinator)
+        return;
+
     if (m_coordinator->isFlushingLayerChanges())
         return;