# HG changeset patch # User sotaro # Date 1518739447 -32400 # Node ID 0a84902451470ab29d1f907e91c4fdd78f4b4a2d # Parent f4a15e090391fd173dff320ad69c7e2b97ab0dcf Bug 1438408 - Shutdown RenderThread if it exists r=nical diff --git a/gfx/ipc/GPUParent.cpp b/gfx/ipc/GPUParent.cpp --- a/gfx/ipc/GPUParent.cpp +++ b/gfx/ipc/GPUParent.cpp @@ -451,17 +451,19 @@ GPUParent::ActorDestroy(ActorDestroyReas if (mVsyncBridge) { mVsyncBridge->Shutdown(); mVsyncBridge = nullptr; } dom::VideoDecoderManagerParent::ShutdownVideoBridge(); CompositorThreadHolder::Shutdown(); VRListenerThreadHolder::Shutdown(); - if (gfxVars::UseWebRender()) { + // There is a case that RenderThread exists when gfxVars::UseWebRender() is false. + // This could happen when WebRender was fallbacked to compositor. + if (wr::RenderThread::Get()) { wr::RenderThread::ShutDown(); wr::WebRenderAPI::ShutdownExternalLogHandler(); } Factory::ShutDown(); #if defined(XP_WIN) DeviceManagerDx::Shutdown(); #endif diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -1068,17 +1068,19 @@ gfxPlatform::ShutdownLayersIPC() } } else if (XRE_IsParentProcess()) { gfx::VRManagerChild::ShutDown(); layers::CompositorManagerChild::Shutdown(); layers::ImageBridgeChild::ShutDown(); // This has to happen after shutting down the child protocols. layers::CompositorThreadHolder::Shutdown(); gfx::VRListenerThreadHolder::Shutdown(); - if (gfxVars::UseWebRender()) { + // There is a case that RenderThread exists when gfxVars::UseWebRender() is false. + // This could happen when WebRender was fallbacked to compositor. + if (wr::RenderThread::Get()) { wr::RenderThread::ShutDown(); Preferences::UnregisterCallback(WebRenderDebugPrefChangeCallback, WR_DEBUG_PREF); } } else { // TODO: There are other kind of processes and we should make sure gfx // stuff is either not created there or shut down properly.