back out bug 1065536 part 2 for maybe causing crashes.

This commit is contained in:
Andrew McCreight 2015-01-20 13:20:54 -08:00
parent fd4d6496b2
commit ae9c0ad9f2

View File

@ -96,6 +96,7 @@ CompositorChild::Create(Transport* aTransport, ProcessId aOtherProcess)
sCompositor->SendGetTileSize(&width, &height);
gfxPlatform::GetPlatform()->SetTileSize(width, height);
// We release this ref in ActorDestroy().
return sCompositor;
}
@ -180,13 +181,14 @@ CompositorChild::ActorDestroy(ActorDestroyReason aWhy)
NS_RUNTIMEABORT("ActorDestroy by IPC channel failure at CompositorChild");
}
#endif
if (sCompositor) {
sCompositor->Release();
sCompositor = nullptr;
}
// We don't want to release the ref to sCompositor here, during
// cleanup, because that will cause it to be deleted while it's
// still being used. So defer the deletion to after it's not in
// use.
sCompositor = nullptr;
MessageLoop::current()->PostTask(
FROM_HERE,
NewRunnableMethod(this, &CompositorChild::Release));