mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-15 21:36:20 +00:00
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.
This commit is contained in:
parent
c9c7c78bbe
commit
01bcb15814
@ -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();
|
||||
|
@ -370,6 +370,7 @@ NS_IMETHODIMP nsXULWindow::Destroy()
|
||||
return NS_OK;
|
||||
|
||||
#ifdef XP_MAC // Anyone still using native menus should add themselves here.
|
||||
{
|
||||
// unregister as document listener
|
||||
// this is needed for menus
|
||||
nsCOMPtr<nsIContentViewer> cv;
|
||||
@ -383,6 +384,7 @@ NS_IMETHODIMP nsXULWindow::Destroy()
|
||||
/* if(doc)
|
||||
doc->RemoveObserver(NS_STATIC_CAST(nsIDocumentObserver*, this)); */
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsIAppShellService> appShell(do_GetService(kAppShellServiceCID));
|
||||
|
Loading…
x
Reference in New Issue
Block a user