Re: Problems with runModalForWindow, looking for alternatives
Re: Problems with runModalForWindow, looking for alternatives
- Subject: Re: Problems with runModalForWindow, looking for alternatives
- From: Vojtěch Meluzín <email@hidden>
- Date: Tue, 01 Nov 2011 20:30:27 +0100
Sure. I used AbortModal, just in case it's not from the main thread, then
performed release once, since I have also allocated it. Still 1 remains. I
also used autorelease pool in for the modal processing. But still
retainCount is 1 after my release. And after that Mac OS tries to redraw
the view...
Vojtech
2011/11/1 Gary L. Wade <email@hidden>
> Did you try calling stopModal or one of its variants before releasing it?
> And, did you release the window rather than dealloc'ing it? Try those to
> get rid of your crash.
> --
> Gary L. Wade
> http://www.garywade.com/
>
>
> On 11/01/2011 11:41 AM, "Vojtěch Meluzín" <email@hidden>
> wrote:
>
> >But the retainCount is needed for successful release of the window, right?
> >I allocate the window and then deallocate it when I'm finished with it.
> >But
> >runModalForWindow increases retainCount to 2, so when I release it, it's
> >actually not destroyed and causes a crash afterward, because for some
> >crazy
> >reason the OS tries to repaint the view in it, despite the window is
> >already closed...
>
>
>
_______________________________________________
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