Merge pull request #60 from RobertWHurst/master

WebGLRender should cleanup previous stage.
This commit is contained in:
Mat Groves 2013-04-09 00:36:31 -07:00
commit ab0a0bee6c

View file

@ -166,6 +166,14 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
{
if(this.contextLost)return;
//clear objects left behind by the previous stage
if(!this.__stage) this.__stage = stage
if(this.__stage && this.__stage !== stage)
{
this.checkVisibility(this.__stage, false)
this.__stage = stage
}
// update children if need be
// best to remove first!
for (var i=0; i < stage.__childrenRemoved.length; i++)