mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1004191 - Destroy LayerTransactionChild r=nical,bjacob
This commit is contained in:
parent
7faee3d635
commit
5fd73fc63c
@ -2725,8 +2725,8 @@ nsDOMWindowUtils::AdvanceTimeAndRefresh(int64_t aMilliseconds)
|
||||
nsRefreshDriver* driver = GetPresContext()->RefreshDriver();
|
||||
driver->AdvanceTimeAndRefresh(aMilliseconds);
|
||||
|
||||
LayerTransactionChild* transaction = GetLayerTransaction();
|
||||
if (transaction) {
|
||||
RefPtr<LayerTransactionChild> transaction = GetLayerTransaction();
|
||||
if (transaction && transaction->IPCOpen()) {
|
||||
transaction->SendSetTestSampleTime(driver->MostRecentRefresh());
|
||||
}
|
||||
|
||||
@ -2743,8 +2743,8 @@ nsDOMWindowUtils::RestoreNormalRefresh()
|
||||
// Kick the compositor out of test mode before the refresh driver, so that
|
||||
// the refresh driver doesn't send an update that gets ignored by the
|
||||
// compositor.
|
||||
LayerTransactionChild* transaction = GetLayerTransaction();
|
||||
if (transaction) {
|
||||
RefPtr<LayerTransactionChild> transaction = GetLayerTransaction();
|
||||
if (transaction && transaction->IPCOpen()) {
|
||||
transaction->SendLeaveTestMode();
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ CompositorChild::Destroy()
|
||||
mLayerManager->Destroy();
|
||||
mLayerManager = nullptr;
|
||||
while (size_t len = ManagedPLayerTransactionChild().Length()) {
|
||||
LayerTransactionChild* layers =
|
||||
RefPtr<LayerTransactionChild> layers =
|
||||
static_cast<LayerTransactionChild*>(ManagedPLayerTransactionChild()[len - 1]);
|
||||
layers->Destroy();
|
||||
}
|
||||
|
@ -22,10 +22,19 @@ namespace layers {
|
||||
void
|
||||
LayerTransactionChild::Destroy()
|
||||
{
|
||||
if (!IPCOpen() || mDestroyed) {
|
||||
return;
|
||||
}
|
||||
// mDestroyed is used to prevent calling Send__delete__() twice.
|
||||
// When this function is called from CompositorChild::Destroy(),
|
||||
// under Send__delete__() call, this function is called from
|
||||
// ShadowLayerForwarder's destructor.
|
||||
// When it happens, IPCOpen() is still true.
|
||||
// See bug 1004191.
|
||||
mDestroyed = true;
|
||||
NS_ABORT_IF_FALSE(0 == ManagedPLayerChild().Length(),
|
||||
"layers should have been cleaned up by now");
|
||||
PLayerTransactionChild::Send__delete__(this);
|
||||
// WARNING: |this| has gone to the great heap in the sky
|
||||
}
|
||||
|
||||
|
||||
|
@ -46,6 +46,8 @@ public:
|
||||
protected:
|
||||
LayerTransactionChild()
|
||||
: mIPCOpen(false)
|
||||
, mDestroyed(false)
|
||||
, mForwarder(nullptr)
|
||||
{}
|
||||
~LayerTransactionChild() { }
|
||||
|
||||
@ -78,6 +80,7 @@ protected:
|
||||
friend class layout::RenderFrameChild;
|
||||
|
||||
bool mIPCOpen;
|
||||
bool mDestroyed;
|
||||
ShadowLayerForwarder* mForwarder;
|
||||
};
|
||||
|
||||
|
@ -179,6 +179,7 @@ ShadowLayerForwarder::~ShadowLayerForwarder()
|
||||
delete mTxn;
|
||||
if (mShadowManager) {
|
||||
mShadowManager->SetForwarder(nullptr);
|
||||
mShadowManager->Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user