Add some scoping {} to keep nsCOMPtrs within #ifdef code scope. This make window destruction order similar on Mac and other platforms, thereby fixing bug 38869 and maybe some other leaks.

git-svn-id: svn://10.0.0.236/trunk@69126 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sfraser%netscape.com
2000-05-11 01:08:37 +00:00
parent b5aaf45c85
commit 42773cae35
2 changed files with 4 additions and 0 deletions

View File

@@ -1710,6 +1710,7 @@ nsWebShellWindow::NotifyObservers( const nsString &aTopic, const nsString &someD
NS_IMETHODIMP nsWebShellWindow::Destroy()
{
#ifdef USE_NATIVE_MENUS
{
// unregister as document listener
// this is needed for menus
nsCOMPtr<nsIContentViewer> cv;
@@ -1723,6 +1724,7 @@ NS_IMETHODIMP nsWebShellWindow::Destroy()
if(doc)
doc->RemoveObserver(NS_STATIC_CAST(nsIDocumentObserver*, this));
}
}
#endif
return nsXULWindow::Destroy();