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