NSSound Leaks?
NSSound Leaks?
Is there a memory leak in NSSound? I'm using it in a screensaver, where
each subview has it's
own 'copy' of a sound loaded at startup. This is so I can have the sound
fire at the start of each
subview and be asynchronous. When the subview is removed I make sure that
I've released the
sound in the subview class' dealloc. Here's my problem; after the
screensaver's been running
for awhile, it bogs down, and is slow to recover when exiting the
screensaver. It appears to
freeze the computer, but it eventually fully recovers after about a minute
or so.
Here's a snippet of code from the subview class:
- (id)initWithFrame:(NSRect)frame {
... // various unrelated init code
if (SR_MuteSound == NO) {
popSound = [SR_poppingSound copy]; // SR_poppingSound is a
global NSSound
[popSound play];
}
...
}
// destroySprite
- (void) destroySprite
{
[self removeFromSuperview];
}
// dealloc
- (void)dealloc
{
NSNotificationCenter *nc;
nc = [NSNotificationCenter defaultCenter];
[nc removeObserver:self];
[popSound release];
[super dealloc];
}
Any ideas?
Best regards,
Michael Briscoe
--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .
_______________________________________________
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.