Bug 268513 overflow:scroll causes memory growth

r/sr=bz, a=asa
This commit is contained in:
kyle.yuan@sun.com
2005-04-07 23:50:40 +00:00
parent 2fdd9afe18
commit f39944e155

View File

@@ -1401,6 +1401,7 @@ protected:
PRPackedBool mDocumentLoading;
PRPackedBool mIsReflowing;
PRPackedBool mIsDestroying;
PRPackedBool mIsReleasingAnonymousContent;
PRPackedBool mDidInitialReflow;
PRPackedBool mIgnoreFrameDestruction;
@@ -1654,6 +1655,7 @@ PresShell::PresShell()
#endif
mSelectionFlags = nsISelectionDisplay::DISPLAY_TEXT | nsISelectionDisplay::DISPLAY_IMAGES;
mIsThemeSupportDisabled = PR_FALSE;
mIsReleasingAnonymousContent = PR_FALSE;
new (this) nsFrameManager();
}
@@ -4906,6 +4908,9 @@ PresShell::SetAnonymousContentFor(nsIContent* aContent, nsISupportsArray* aAnony
content->UnbindFromTree();
}
if (!mIsReleasingAnonymousContent)
mAnonymousContentTable->Remove(&key);
}
}
@@ -4954,6 +4959,7 @@ NS_IMETHODIMP
PresShell::ReleaseAnonymousContent()
{
if (mAnonymousContentTable) {
mIsReleasingAnonymousContent = PR_TRUE;
mAnonymousContentTable->Enumerate(ClearDocumentEnumerator);
delete mAnonymousContentTable;
mAnonymousContentTable = nsnull;