Clear the undisplayed content map before calling SetDocument(null), which can cause some XBL content to be destroyed without notifications, leaving dangling pointers in the undisplayed map. b=145737 r=bzbarsky sr=waterson

This commit is contained in:
dbaron%fas.harvard.edu 2002-05-26 17:03:42 +00:00
Родитель ce4478beee
Коммит e6315d638a
2 изменённых файлов: 22 добавлений и 0 удалений

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

@ -1618,6 +1618,17 @@ DocumentViewerImpl::Close()
}
#endif
// Before we clear the script global object, clear the undisplayed
// content map, since XBL content can be destroyed by the
// |SetDocument(null, ...)| triggered by calling
// |SetScriptGlobalObject(null)|.
if (mPresShell) {
nsCOMPtr<nsIFrameManager> frameManager;
mPresShell->GetFrameManager(getter_AddRefs(frameManager));
if (frameManager)
frameManager->ClearUndisplayedContentMap();
}
// Break global object circular reference on the document created
// in the DocViewer Init
nsCOMPtr<nsIScriptGlobalObject> globalObject;

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

@ -1618,6 +1618,17 @@ DocumentViewerImpl::Close()
}
#endif
// Before we clear the script global object, clear the undisplayed
// content map, since XBL content can be destroyed by the
// |SetDocument(null, ...)| triggered by calling
// |SetScriptGlobalObject(null)|.
if (mPresShell) {
nsCOMPtr<nsIFrameManager> frameManager;
mPresShell->GetFrameManager(getter_AddRefs(frameManager));
if (frameManager)
frameManager->ClearUndisplayedContentMap();
}
// Break global object circular reference on the document created
// in the DocViewer Init
nsCOMPtr<nsIScriptGlobalObject> globalObject;