mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 1389021 - Release the compositor thread after CompositorManagerParent IPDL reference is released. r=nical
We need to ensure the compositor thread is released but we cannot upon freeing CompositorManagerParent to do that. This is because it needs to live longer than the thread so that shared memory allocated with this top level protocol can be freed after the fact. As such, just release the thread reference after IPDL has released CompositorManagerParent.
This commit is contained in:
parent
b3bc155fb6
commit
ec1a805248
@ -138,9 +138,20 @@ CompositorManagerParent::ActorDestroy(ActorDestroyReason aReason)
|
||||
void
|
||||
CompositorManagerParent::DeallocPCompositorManagerParent()
|
||||
{
|
||||
MessageLoop::current()->PostTask(
|
||||
NewRunnableMethod("layers::CompositorManagerParent::DeferredDestroy",
|
||||
this,
|
||||
&CompositorManagerParent::DeferredDestroy));
|
||||
|
||||
Release();
|
||||
}
|
||||
|
||||
void
|
||||
CompositorManagerParent::DeferredDestroy()
|
||||
{
|
||||
mCompositorThreadHolder = nullptr;
|
||||
}
|
||||
|
||||
PCompositorBridgeParent*
|
||||
CompositorManagerParent::AllocPCompositorBridgeParent(const CompositorBridgeOptions& aOpt)
|
||||
{
|
||||
|
@ -50,6 +50,8 @@ private:
|
||||
|
||||
void DeallocPCompositorManagerParent() override;
|
||||
|
||||
void DeferredDestroy();
|
||||
|
||||
RefPtr<CompositorThreadHolder> mCompositorThreadHolder;
|
||||
|
||||
AutoTArray<RefPtr<CompositorBridgeParent>, 1> mPendingCompositorBridges;
|
||||
|
Loading…
Reference in New Issue
Block a user