• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
runModalForWindow crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

runModalForWindow crash


  • Subject: runModalForWindow crash
  • From: Jo Meder <email@hidden>
  • Date: Mon, 25 Jan 2010 14:14:45 +1300

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@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: runModalForWindow crash
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: NSURL crash
  • Next by Date: Re: NSURL crash
  • Previous by thread: Re: NSURL crash
  • Next by thread: Re: runModalForWindow crash
  • Index(es):
    • Date
    • Thread