ThreadedCompositor: clean up composition-specific resources before shutting down...
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Mar 2016 07:39:23 +0000 (07:39 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Mar 2016 07:39:23 +0000 (07:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=154793

Reviewed by Carlos Garcia Campos.

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::runCompositingThread): Before concluding the
compositing thread run, clean up all the resources that were allocated at
the start, and in the reverse order. Specifically, we now also deallocate
the CoordinatedGraphicsScene and the SimpleViewportController objects. This
way these are not deallocated on the main thread when the ThreadedCompositor
destructor would otherwise clean them up.

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

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp

index 646e9ea..3a121f4 100644 (file)
@@ -1,5 +1,20 @@
 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
 
+        ThreadedCompositor: clean up composition-specific resources before shutting down the thread
+        https://bugs.webkit.org/show_bug.cgi?id=154793
+
+        Reviewed by Carlos Garcia Campos.
+
+        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
+        (WebKit::ThreadedCompositor::runCompositingThread): Before concluding the
+        compositing thread run, clean up all the resources that were allocated at
+        the start, and in the reverse order. Specifically, we now also deallocate
+        the CoordinatedGraphicsScene and the SimpleViewportController objects. This
+        way these are not deallocated on the main thread when the ThreadedCompositor
+        destructor would otherwise clean them up.
+
+2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
+
         ThreadSafeCoordinatedSurface: remove the unused private create() static method
         https://bugs.webkit.org/show_bug.cgi?id=154792
 
index fec5f69..bb7e86d 100644 (file)
@@ -331,8 +331,10 @@ void ThreadedCompositor::runCompositingThread()
 
     {
         LockHolder locker(m_terminateRunLoopConditionMutex);
-        m_compositingRunLoop = nullptr;
         m_context = nullptr;
+        m_scene = nullptr;
+        m_viewportController = nullptr;
+        m_compositingRunLoop = nullptr;
         m_terminateRunLoopCondition.notifyOne();
     }