Fix VsyncBridgeParent leaking on GPU process shutdown. (bug 1308398 part 2, r=mattwoodrow)

This commit is contained in:
David Anderson
2016-10-12 00:08:36 -07:00
parent e2b42a4efd
commit b993358662
3 changed files with 10 additions and 2 deletions

View File

@@ -169,7 +169,7 @@ GPUParent::RecvInit(nsTArray<GfxPrefSetting>&& prefs,
bool
GPUParent::RecvInitVsyncBridge(Endpoint<PVsyncBridgeParent>&& aVsyncEndpoint)
{
VsyncBridgeParent::Start(Move(aVsyncEndpoint));
mVsyncBridge = VsyncBridgeParent::Start(Move(aVsyncEndpoint));
return true;
}
@@ -325,6 +325,7 @@ GPUParent::ActorDestroy(ActorDestroyReason aWhy)
if (mVsyncBridge) {
mVsyncBridge->Shutdown();
mVsyncBridge = nullptr;
}
CompositorThreadHolder::Shutdown();
#if defined(XP_WIN)

View File

@@ -55,10 +55,16 @@ VsyncBridgeParent::Shutdown()
{
MessageLoop* ccloop = CompositorThreadHolder::Loop();
if (MessageLoop::current() != ccloop) {
ccloop->PostTask(NewRunnableMethod(this, &VsyncBridgeParent::Shutdown));
ccloop->PostTask(NewRunnableMethod(this, &VsyncBridgeParent::ShutdownImpl));
return;
}
ShutdownImpl();
}
void
VsyncBridgeParent::ShutdownImpl()
{
if (mOpen) {
Close();
mOpen = false;

View File

@@ -30,6 +30,7 @@ private:
~VsyncBridgeParent();
void Open(Endpoint<PVsyncBridgeParent>&& aEndpoint);
void ShutdownImpl();
private:
bool mOpen;