зеркало из https://github.com/mozilla/gecko-dev.git
Bug 737437 - Destroy the compositor's layer manager before the CompositorChild gets destroyed. r=cjones
This commit is contained in:
Родитель
431906e35b
Коммит
a9d6e29a0f
|
@ -78,14 +78,24 @@ CompositorParent::Destroy()
|
|||
NS_ABORT_IF_FALSE(ManagedPLayersParent().Length() == 0,
|
||||
"CompositorParent destroyed before managed PLayersParent");
|
||||
|
||||
// Ensure that the layer manager is destroyed on the compositor thread.
|
||||
// Ensure that the layer manager is destructed on the compositor thread.
|
||||
mLayerManager = NULL;
|
||||
}
|
||||
|
||||
bool
|
||||
CompositorParent::RecvWillStop()
|
||||
{
|
||||
mPaused = true;
|
||||
|
||||
// Ensure that the layer manager is destroyed before CompositorChild.
|
||||
mLayerManager->Destroy();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
CompositorParent::RecvStop()
|
||||
{
|
||||
mPaused = true;
|
||||
Destroy();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -93,6 +93,7 @@ public:
|
|||
CompositorParent(nsIWidget* aWidget, base::Thread* aCompositorThread);
|
||||
virtual ~CompositorParent();
|
||||
|
||||
virtual bool RecvWillStop() MOZ_OVERRIDE;
|
||||
virtual bool RecvStop() MOZ_OVERRIDE;
|
||||
virtual bool RecvPause() MOZ_OVERRIDE;
|
||||
virtual bool RecvResume() MOZ_OVERRIDE;
|
||||
|
|
|
@ -61,7 +61,10 @@ rpc protocol PCompositor
|
|||
|
||||
parent:
|
||||
|
||||
// Clean up in preparation for destruction.
|
||||
// The child is about to be destroyed, so perform any necessary cleanup.
|
||||
sync WillStop();
|
||||
|
||||
// Clean up in preparation for own destruction.
|
||||
sync Stop();
|
||||
|
||||
// Pause/resume the compositor. These are intended to be used on mobile, when
|
||||
|
|
|
@ -153,6 +153,8 @@ nsBaseWidget::~nsBaseWidget()
|
|||
}
|
||||
|
||||
if (mCompositorChild) {
|
||||
mCompositorChild->SendWillStop();
|
||||
MessageLoop::current()->RunAllPending();
|
||||
mCompositorChild->Destroy();
|
||||
delete mCompositorThread;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче