X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb8dcb05283b9ccfd130eeb0bdae24b6615d5ce8..55410bb4f67febe1ca20654f078ea4fb9a6223ae:/src/osx/cocoa/dialog.mm?ds=sidebyside 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 ?