Is there a simple way to destroy all sublayers? Something like foo.subLayers.destroy()?
I've also tried storing all my layers in an array and then emptying the array, but the layers are not destroyed :(
Destroyed as in removed from memory?
I have a post about this on http://FramerCo.de and how you can listen for those events.
The trick here is that I'm creating layers by iterating through an array. By assigning each layer to an index in the array I am only pointing to them. So when I empty the array the layer lives on!
Also protip: _.invoke(layer.subLayers, "destroy")