[Prev] Thread [Next]  |  [Prev] Date [Next]

Issue 859 in cocos2d-iphone: Cocos Denshion crashes app when unloading effects cocos2d-iphone Thu May 06 14:01:19 2010

Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 859 by SweKenchu: Cocos Denshion crashes app when unloading effects

What steps will reproduce the problem?
Unload a lot of preloaded effects using -(void) unloadEffect:(NSString*)

Load a lot of wav's into memory using -(void) preloadEffect:(NSString*)

2. Do both these things for a while.
3. Eventually, you will get
Program received signal:  “EXC_BAD_ACCESS”.

Because soundId will not be valid in the unloadEffect method. It will
already have been released.

What is the expected output? What do you see instead?
App shouldn't crash.

What cocos2d version / SVN revision are you using ?

What iPhoneSDK are you using ?

Debug or Release ?

Does this happens on device ? or on the simulator ? or on both ?
Mostly device

Please provide any additional information below.
I suggest you switch places with:

        [loadedEffects removeObjectForKey:filePath];
        [soundEngine unloadBuffer:[soundId intValue]];

So the soundId isn't released until after.

You received this message because you are subscribed to the Google Groups 
"cocos2d-iphone-issues" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at