Stage, does it eventually get garbage collected?
Come to think of it, I have a feeling it might not, as the Lime application will have events to the window, and disabling the stage will still leave the Lime application behind it.
Do you think
stage.dispose () would be a good API to have? Other recommendations are welcome as well.
I think we would need to stop rendering, call
renderer.setShader (null) to disable the current shader, and call
application.exit (though this may a non-op on HTML5).
I think the biggest problem is that right now,
new Stage does not operate within a closure. This means Haxe static values are global, across multiple instances. As a result, a static value from the first run “contaminates” the second run.
new Stage working in isolation, or if we have to design OpenFL around avoiding statics.