Drop evicted content viewers from their SHEntry before calling Destroy, so that state-saving can locate the PresShell. Bug 321778, r=bzbarsky.

git-svn-id: svn://10.0.0.236/trunk@187014 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bryner%brianryner.com
2006-01-05 21:01:24 +00:00
parent 791295acd7
commit d3dcae34e4

View File

@@ -798,9 +798,11 @@ nsSHistory::EvictWindowContentViewers(PRInt32 aFromIndex, PRInt32 aToIndex)
printf("per SHistory limit: evicting content viewer: %s\n", spec.get());
#endif
viewer->Destroy();
// Drop the presentation state before destroying the viewer, so that
// document teardown is able to correctly persist the state.
ownerEntry->SetContentViewer(nsnull);
ownerEntry->SyncPresentationState();
viewer->Destroy();
}
nsISHTransaction *temp = trans;
@@ -906,9 +908,11 @@ nsSHistory::EvictGlobalContentViewer()
}
#endif
evictViewer->Destroy();
// Drop the presentation state before destroying the viewer, so that
// document teardown is able to correctly persist the state.
evictFromSHE->SetContentViewer(nsnull);
evictFromSHE->SyncPresentationState();
evictViewer->Destroy();
// If we only needed to evict one content viewer, then we are done.
// Otherwise, continue evicting until we reach the max total limit.