SoundAS icon indicating copy to clipboard operation
SoundAS copied to clipboard

Destroy of SoundInstance fails after soundCompleted

Open Lauwisme opened this issue 12 years ago • 0 comments

I do this:

_scenarioSounds.play("audioStart").soundCompleted.addOnce(startSoundComplete);

and in the next function I try to tidy up and release the memory used by the sound:

private function startSoundComplete(si:SoundInstance):void { trace("startSound complete"); si.soundCompleted.removeAll();

                    //cleanup methods I tried.

        //1: _scenarioSounds.removeSound(si.type);
        //2: si.destroy();
    }

Both fail, I presume because of the last line in the destroy function:

fade.end(false);

Since fade is already null this won't work like it's supposed to.

Lauwisme avatar Jul 31 '13 14:07 Lauwisme