Title: [211347] trunk/Source/WebKit2
Revision
211347
Author
[email protected]
Date
2017-01-28 23:15:33 -0800 (Sat, 28 Jan 2017)

Log Message

[Threaded Compositor] Crash when deleting the compositor run loop
https://bugs.webkit.org/show_bug.cgi?id=167545

Reviewed by Michael Catanzaro.

The problem is that we are releasing the WorkQueue before the update timer that keeps a reference to the run
loop, destroyed by the WorkQueue. So, invalidate the WorkQueue in the next run loop iteration to ensure it
happens after the CompositingRunLoop destructor.

* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::CompositingRunLoop::~CompositingRunLoop):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (211346 => 211347)


--- trunk/Source/WebKit2/ChangeLog	2017-01-29 07:14:12 UTC (rev 211346)
+++ trunk/Source/WebKit2/ChangeLog	2017-01-29 07:15:33 UTC (rev 211347)
@@ -1,5 +1,19 @@
 2017-01-28  Carlos Garcia Campos  <[email protected]>
 
+        [Threaded Compositor] Crash when deleting the compositor run loop
+        https://bugs.webkit.org/show_bug.cgi?id=167545
+
+        Reviewed by Michael Catanzaro.
+
+        The problem is that we are releasing the WorkQueue before the update timer that keeps a reference to the run
+        loop, destroyed by the WorkQueue. So, invalidate the WorkQueue in the next run loop iteration to ensure it
+        happens after the CompositingRunLoop destructor.
+
+        * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
+        (WebKit::CompositingRunLoop::~CompositingRunLoop):
+
+2017-01-28  Carlos Garcia Campos  <[email protected]>
+
         [GTK] ASSERTION FAILED: !m_layerTreeHost in DrawingAreaImpl::display()
         https://bugs.webkit.org/show_bug.cgi?id=167548
 

Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp (211346 => 211347)


--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp	2017-01-29 07:14:12 UTC (rev 211346)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp	2017-01-29 07:15:33 UTC (rev 211347)
@@ -119,7 +119,11 @@
 
 CompositingRunLoop::~CompositingRunLoop()
 {
-    WorkQueuePool::singleton().invalidate(this);
+    ASSERT(isMainThread());
+    // Make sure the WorkQueue is deleted after the CompositingRunLoop, because m_updateTimer has a reference
+    // of the WorkQueue run loop. Passing this is not a problem because the pointer will only be used as a
+    // HashMap key by WorkQueuePool.
+    RunLoop::main().dispatch([context = this] { WorkQueuePool::singleton().invalidate(context); });
 }
 
 void CompositingRunLoop::performTask(Function<void ()>&& function)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to