Skip to content

Destroy of SoundInstance fails after soundCompleted #12

@Lauwisme

Description

@Lauwisme

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions