Bug 576480 crash [@ PresShell::Destroy] mDocument->HasAnimationController() after null checked block

r=dholbert

--HG--
extra : rebase_source : da85de78f8bde67ffe713228b0a2b22bd3a4836d
This commit is contained in:
timeless@mozdev.org 2010-07-02 18:21:32 +03:00
parent 4bf66b5163
commit 31a9177ac9

View File

@ -1913,6 +1913,7 @@ PresShell::Destroy()
}
mStyleSet->BeginShutdown(mPresContext);
nsRefreshDriver* rd = GetPresContext()->RefreshDriver();
// This shell must be removed from the document before the frame
// hierarchy is torn down to avoid finding deleted frames through
@ -1920,14 +1921,13 @@ PresShell::Destroy()
if (mDocument) {
NS_ASSERTION(mDocument->GetShell() == this, "Wrong shell?");
mDocument->DeleteShell();
}
nsRefreshDriver* rd = GetPresContext()->RefreshDriver();
#ifdef MOZ_SMIL
if (mDocument->HasAnimationController()) {
mDocument->GetAnimationController()->StopSampling(rd);
}
if (mDocument->HasAnimationController()) {
mDocument->GetAnimationController()->StopSampling(rd);
}
#endif // MOZ_SMIL
}
// Revoke any pending events. We need to do this and cancel pending reflows
// before we destroy the frame manager, since apparently frame destruction