soundmanager 2: how necessary is it to call destruct()?

53 views Asked by At

I'm building a Meteor site with lots of sounds being loaded on various pages. How necessary is it to call destruct() when switching pages?

Does SM2 do it's own clean up? Will it just keep on taking up memory for sounds until my browser explodes?

1

There are 1 answers

0
Mike Robinson On

I'd say that: "if any library provides a destruct() call, there must be a reason!

If "a page switch" is an easily-identified point in time at which you can safely conclude that "the following resources will no longer be necessary," then you should always tell the package this, using whatever API-calls it provides for this purpose. Do not assume that the package will "automagically" know how to do this for you. In fact, assume that it won't.