Bug 1554438 - P2. Only shutdown thread if it was started. r=sotaro
authorJean-Yves Avenard <jyavenard@mozilla.com>
Sun, 26 May 2019 02:17:10 +0000
changeset 475594 5247954abf59df1fb2d4ad09959ff4e2070febb1
parent 475593 e40827b3a3529655f902392eac05906ff815acd4
child 475595 c63967f172ee0d2c6624fdce772599efe87836ac
push id113212
push userrmaries@mozilla.com
push dateSun, 26 May 2019 09:40:24 +0000
treeherdermozilla-inbound@8388f1163e54 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1554438
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1554438 - P2. Only shutdown thread if it was started. r=sotaro It is theorically possible that the WinCompositorWindowThread failed to start. Should this happen, attempting to shut it down will cause shutdown to hang forever. Differential Revision: https://phabricator.services.mozilla.com/D32602
gfx/webrender_bindings/RenderThread.cpp
--- a/gfx/webrender_bindings/RenderThread.cpp
+++ b/gfx/webrender_bindings/RenderThread.cpp
@@ -96,17 +96,19 @@ void RenderThread::ShutDown() {
   RefPtr<Runnable> runnable =
       WrapRunnable(RefPtr<RenderThread>(sRenderThread.get()),
                    &RenderThread::ShutDownTask, &task);
   sRenderThread->Loop()->PostTask(runnable.forget());
   task.Wait();
 
   sRenderThread = nullptr;
 #ifdef XP_WIN
-  widget::WinCompositorWindowThread::ShutDown();
+  if (widget::WinCompositorWindowThread::Get()) {
+    widget::WinCompositorWindowThread::ShutDown();
+  }
 #endif
 }
 
 extern void ClearAllBlobImageResources();
 
 void RenderThread::ShutDownTask(layers::SynchronousTask* aTask) {
   layers::AutoCompleteTask complete(aTask);
   MOZ_ASSERT(IsInRenderThread());