Am Mo,25.08.2008 um 07:50 schrieb Graham Cox:


On 25 Aug 2008, at 11:09 am, Kyle Sluder wrote:

On Sun, Aug 24, 2008 at 6:03 PM, Cate Tony <[EMAIL PROTECTED]> wrote:
If I put a retain on the panel, the error stops, but isn't it now leaking?

No.  You took ownership of the NSSavePanel when you created it by
using a convenience constructor.  You must retain it, and release it
when you're done with it.


Except that the NSSavePanel docs state:

"An NSSavePanel object is a singleton: when you request a Save panel, NSSavePanel tries to reuse an existing Save panel rather than create a new one"

I don't usually retain it and have never seen this crash... but I also see it says TRIES to... so maybe it creates new instances sometimes depending on the parameters. It would be good to have a bit more certainty in the docs on this one - is it a singleton or not, and if not, under what circumstances exactly is that?
Don't care about this. IF it is a singleton, retaining is no problem. IF it is NOT, retaining is the right way to handle it.

However, as Cate said: You are the owner and you have to take care about it. What $somebodyelse is does is not your problem.

@TS
A -retain is no memory leak. A -retain without -release is a memory leak.

Cheers,
Amin



cheers, Graham
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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/negm-awad%40cocoading.de

This email sent to [EMAIL PROTECTED]

Amin Negm-Awad
[EMAIL PROTECTED]




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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]

Reply via email to