Hi,
In my app I'm showing a modal window by calling [NSApp runModalForWindow] with
the window. When I want to close the dialog I essentially do this:
NSWindow* macWindow = ( NSWindow* )theDialog.GetNativeWindow();
if ( [NSApp modalWindow] == macWindow )
{
[NSApp abortModal];
}
[macWindow setReleasedWhenClosed:YES];
[macWindow close];
However I shortly afterward get a crash (EXC_BAD_ACCESS), the partial stack of
which looks like this:
#0 0x91f43ed7 in objc_msgSend
#1 0x0216c180 in ??
#2 0x976b2ae1 in -[NSApplication runModalForWindow:]
#3 0x000c70d2 in
UnderC::details::UCMacEventManagerImp::RunModalLoopForDialog at
UCMacEventManagerImp.mm:79 <- ( where I call runModalForWindow )
My guess is that [NSApplication runModalForWindow:] is trying to send a message
to my window object which has been released by now perhaps? I think I'm
probably not getting something to do with object lifetimes here or something.
Does anyone have any ideas what the problem might be?
Regards,
Jo Meder
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]