From 48b1db01ed0f06e83da911cf11f309aaaf80b34e Mon Sep 17 00:00:00 2001 From: "tbogard%aol.net" Date: Tue, 8 Feb 2000 16:14:55 +0000 Subject: [PATCH] Ooops, XULWindow doesn't implement nsIDocumentObserver. Commented it out for now and moved the removal of the observer back to webshellwindow. This should fix the mac build. --- xpfe/appshell/src/nsWebShellWindow.cpp | 18 +++++++++++++++++- xpfe/appshell/src/nsXULWindow.cpp | 4 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/xpfe/appshell/src/nsWebShellWindow.cpp b/xpfe/appshell/src/nsWebShellWindow.cpp index 95ad04eb17f3..5860643dfbfe 100644 --- a/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/xpfe/appshell/src/nsWebShellWindow.cpp @@ -372,7 +372,23 @@ nsresult nsWebShellWindow::Initialize(nsIWebShellWindow* aParent, NS_METHOD nsWebShellWindow::Close() { - return nsXULWindow::Destroy(); +#ifdef XP_MAC // Anyone still using native menus should add themselves here. + // unregister as document listener + // this is needed for menus + nsCOMPtr cv; + if(mDocShell) + mDocShell->GetContentViewer(getter_AddRefs(cv)); + nsCOMPtr docv(do_QueryInterface(cv)); + if(docv) + { + nsCOMPtr doc; + docv->GetDocument(*getter_AddRefs(doc)); + if(doc) + doc->RemoveObserver(NS_STATIC_CAST(nsIDocumentObserver*, this)); + } +#endif + + return nsXULWindow::Destroy(); } diff --git a/xpfe/appshell/src/nsXULWindow.cpp b/xpfe/appshell/src/nsXULWindow.cpp index 29401531333d..91f18044918e 100644 --- a/xpfe/appshell/src/nsXULWindow.cpp +++ b/xpfe/appshell/src/nsXULWindow.cpp @@ -288,8 +288,8 @@ NS_IMETHODIMP nsXULWindow::Destroy() { nsCOMPtr doc; docv->GetDocument(*getter_AddRefs(doc)); - if(doc) - doc->RemoveObserver(NS_STATIC_CAST(nsIDocumentObserver*, this)); +/* if(doc) + doc->RemoveObserver(NS_STATIC_CAST(nsIDocumentObserver*, this)); */ } #endif