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

This commit is contained in:
bryner%brianryner.com 2006-01-05 21:01:24 +00:00
Родитель 18e7b7ce3a
Коммит f0aa3c94c1
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -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.