kstenerud/ObjectAL-for-iPhone — Issue #21: sounds are not released from memory
Author: bartekhugo
Created: 2011-12-19 15:17:33+00:00
State: open

hey ive noticed that every sound file loaded into memory (im using playEffect without preloading it first) is never being released from memory...
even worse when im using [[OALSimpleAudio sharedInstance] unloadAllEffects]; then sound is removed from preloadCache so the next time it is again loaded into memory (so in fact in the memory one file might be loaded more than once)

for my app this is a big problem, lots of sounds might cause crashes because of memory overflow

where those albuffer objects are retained beside from preloadCache?

when i did something like this in internalPreloadEffect method

[preloadCache setObject:buffer forKey:filePath];
arcsafe_release(buffer); << this is new

and than

[[OALSimpleAudio sharedInstance] stopEverything]; (without this if a sound is being played it crashes when releasing from memory)
[[OALSimpleAudio sharedInstance] unloadAllEffects];

i can really release then from memory

am i doing something wrong or is it a bug?
i was testing it on iPad 1 with iOS 5.0 onboard