Skip to content
Permalink
Browse files
[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):

Canonical link: https://commits.webkit.org/184591@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211347 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
carlosgcampos committed Jan 29, 2017
1 parent 8fb74b4 commit 483c4bbbcc55449a573cc333781ca7817daaa162
Showing with 19 additions and 1 deletion.
  1. +14 −0 Source/WebKit2/ChangeLog
  2. +5 −1 Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp
@@ -1,3 +1,17 @@
2017-01-28 Carlos Garcia Campos <cgarcia@igalia.com>

[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 <cgarcia@igalia.com>

[GTK] ASSERTION FAILED: !m_layerTreeHost in DrawingAreaImpl::display()
@@ -119,7 +119,11 @@ CompositingRunLoop::CompositingRunLoop(std::function<void ()>&& updateFunction)

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)

0 comments on commit 483c4bb

Please sign in to comment.