• 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
Re: Problems with runModalForWindow, looking for alternatives
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: Problems with runModalForWindow, looking for alternatives (From: Vojtěch Meluzín <email@hidden>)
 >Re: Problems with runModalForWindow, looking for alternatives (From: "Gary L. Wade" <email@hidden>)

  • Prev by Date: Re: Write to file Entitlement
  • Next by Date: Re: Problems with runModalForWindow, looking for alternatives
  • Previous by thread: Re: Problems with runModalForWindow, looking for alternatives
  • Next by thread: Re: Problems with runModalForWindow, looking for alternatives
  • Index(es):
    • Date
    • Thread