Open trusktr opened 8 years ago
@trusktr just leaving this here for the next victim of this problem...
var Dismount = function(node) {
var aNodes = [];
if ( !(node instanceof famous.core.Node) )
throw "node not a Famous#Node";
var f = function(current) {
aNodes.push(current);
var aChildren = current.getChildren();
for ( var i in aChildren )
f(aChildren[i]);
};
f(node);
while ( aNodes.length ) {
var x = aNodes.pop();
if ( x.isMounted())
x.dismount();
}
}
Haven't had any problems with the above recently.
For reference, the problem is here: https://github.com/Famous/engine/issues/487
Can you give a short example of the proper way to make sure nodes are cleaned up when removed from a scene graph?