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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user