Sitelet https://github.com/treefortress/SoundAS/issues/28
Skip to content

Memory Leak when using .stopAll() #28

Description

@andycorm

I just posted about this on the official starling game engine forum here: http://forum.starling-framework.org/topic/does-anyone-else-use-tree-fortresss-soundas-sound-manager#post-89464 but I'll go ahead and summarize here:

I think I've found a memory leak. If you do something like the following:

SoundAS.play('my_sound').soundCompleted.addOnce(function(si:SoundInstance){
trace('Hello, my name is Mr. Leaky McLeakerson! I'm here to eat your memory.');
}
SoundAS.stopAll();

Using .stopAll() will not remove the callback you just added. The closure hangs around in memory along which whichever class originally added that callback. (In my case, it was the play screen, so needless to say things got out of hand quite quickly.)

I won't rule out that maybe I'm just misunderstanding how SoundAS callbacks are supposed to work. If I'm not understanding the proper way to stop them, I'd love it if you could fill me in.

(Thanks a million for the library BTW, it's been great- save for this one hiccup!)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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