• 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: NSWindow alloc/dealloc problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWindow alloc/dealloc problems


  • Subject: Re: NSWindow alloc/dealloc problems
  • From: Alex Reynolds <email@hidden>
  • Date: Mon, 29 Nov 2004 04:32:52 -0500

I tried [targetWindow release] and I get the same crash.

I have also tried:

[targetWindow setReleasedWhenClosed:YES];

when the targetWindow is allocated.

When I then try [targetWindow close], the first time I release my targetWindow it seems to work, but then when I allocate targetWindow again, it crashes with a type 11 error.

I think only one targetWindow is being allocated, so I don't know why [targetWindow close] doesn't release that one object, so that the [NSWindow alloc] can run properly.

Are there tools I can use to keep track of how many targetWindow objects there really are?

-Alex

On Nov 29, 2004, at 4:24 AM, j o a r wrote:


On 2004-11-29, at 10.07, Alex Reynolds wrote:

[targetWindow dealloc];

Have you read the documentation for the "dealloc" method?

What you need to do is to balance your retain-release calls properly. You should either just release / autorelease the window, or if you have set it to "release when closed", simply close it.

j o a r


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: NSWindow alloc/dealloc problems
      • From: j o a r <email@hidden>
References: 
 >NSWindow alloc/dealloc problems (From: Alex Reynolds <email@hidden>)
 >Re: NSWindow alloc/dealloc problems (From: j o a r <email@hidden>)

  • Prev by Date: Re: NSWindow alloc/dealloc problems
  • Next by Date: checking for line ending types
  • Previous by thread: Re: NSWindow alloc/dealloc problems
  • Next by thread: Re: NSWindow alloc/dealloc problems
  • Index(es):
    • Date
    • Thread