Bug 494283. Unregister our placeholder if someone forgot to. r=dbaron

This commit is contained in:
Boris Zbarsky 2009-08-03 10:42:57 -04:00
parent 6fe5f3a5b9
commit 90ad9f1c3b

View File

@ -127,9 +127,13 @@ nsPlaceholderFrame::Destroy()
{
nsIPresShell* shell = PresContext()->GetPresShell();
if (shell && mOutOfFlowFrame) {
NS_ASSERTION(!shell->FrameManager()->GetPlaceholderFrameFor(mOutOfFlowFrame),
"Placeholder relationship should have been torn down; see "
"comments in nsPlaceholderFrame.h");
if (shell->FrameManager()->GetPlaceholderFrameFor(mOutOfFlowFrame)) {
NS_ERROR("Placeholder relationship should have been torn down; see "
"comments in nsPlaceholderFrame.h. Unregistering ourselves, "
"but this might cause our out-of-flow to be unable to destroy "
"itself properly. Not that it could anyway, with us dead.");
shell->FrameManager()->UnregisterPlaceholderFrame(this);
}
}
nsSplittableFrame::Destroy();