NSSound & autorelease
NSSound & autorelease
- Subject: NSSound & autorelease
- From: Chris Silverberg <email@hidden>
- Date: Sat, 21 Jun 2003 09:57:16 -0700
- Organization: Silverberg.Net
Hello list,
A question... I've seen several developers doing this to play a sound:
[[NSSound soundNamed: @"YouHaveNewMail"] play];
So, is this really safe? NSSound returns an autoreleased instance of a
sound... and 'play' plays the sound asynchronously. What happens if this
sound is playing and the autorelease pool releases its objects?
Now, I could see that this would not be a problem if NSSound did a
self-retain when you call play... and it did a self-release when the sound
completed. But without documentation, I can't just assume that. Does
anyone know the real deal?
thanks much,
Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.