bug 559400 - add local autorelease pool in nsCocoaWindow::SetModal, for startup dialogs. r=josh

This commit is contained in:
Jonathan Kew 2010-04-14 21:13:56 +01:00
parent 1a07188538
commit cc0b88dd4a

View File

@ -530,6 +530,12 @@ NS_IMETHODIMP nsCocoaWindow::IsVisible(PRBool & aState)
NS_IMETHODIMP nsCocoaWindow::SetModal(PRBool aState) NS_IMETHODIMP nsCocoaWindow::SetModal(PRBool aState)
{ {
// This is used during startup (outside the event loop) when creating
// the add-ons compatibility checking dialog and the profile manager UI;
// therefore, it needs to provide an autorelease pool to avoid cocoa
// objects leaking.
nsAutoreleasePool localPool;
mModal = aState; mModal = aState;
nsCocoaWindow *aParent = static_cast<nsCocoaWindow*>(mParent); nsCocoaWindow *aParent = static_cast<nsCocoaWindow*>(mParent);
if (aState) { if (aState) {