Fix VsyncBridgeParent leaking on GPU process shutdown. (bug 1308398 part 2, r=mattwoodrow)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -30,6 +30,7 @@ private:
|
||||
~VsyncBridgeParent();
|
||||
|
||||
void Open(Endpoint<PVsyncBridgeParent>&& aEndpoint);
|
||||
void ShutdownImpl();
|
||||
|
||||
private:
|
||||
bool mOpen;
|
||||
|
||||
Reference in New Issue
Block a user