X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb8dcb05283b9ccfd130eeb0bdae24b6615d5ce8..bb69632a56a827bed4cfae842bfffa88259ac1aa:/src/osx/cocoa/dialog.mm diff --git a/src/osx/cocoa/dialog.mm b/src/osx/cocoa/dialog.mm index 9d99165c63..e5a9d3f658 100644 --- a/src/osx/cocoa/dialog.mm +++ b/src/osx/cocoa/dialog.mm @@ -26,6 +26,9 @@ extern wxList wxModalDialogs; void wxDialog::DoShowModal() { + wxCHECK_RET( !IsModal(), wxT("DoShowModal() called twice") ); + + wxModalDialogs.Append(this); SetFocus() ; /* @@ -41,12 +44,12 @@ void wxDialog::DoShowModal() resetGroupParent = true; } */ - NSWindow* theWindow = GetWXWindow(); NSModalSession session = [NSApp beginModalSessionForWindow:theWindow]; while (IsModal()) { + wxMacAutoreleasePool autoreleasepool; if ([NSApp runModalSession:session] != NSRunContinuesResponse) break; // TODO should we do some idle processing ?