alexvoz / as3isolib

Automatically exported from code.google.com/p/as3isolib
0 stars 0 forks source link

Adding the same object twice to an IsoScene #42

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. _isoScene.addChild(_isoGrid1)
2. Let IsoLib render/update everything
3. _isoScene.addChild(_isoGrid1)
4. Let IsoLib render/update everything
5. _isoScene.removeChild(_isoGrid1)
6. Let IsoLib render/update everything

What is the expected output? What do you see instead?

Expected:Expected is that _isoGrid1 is no longer a child to _isoScene.

What happens: IsoLib crashes when it tries to render.

What version of the product are you using? On what operating system?

Latest IsoLib, Windows 7.

Please provide any additional information below.

I think the issue lies in IsoContainer (or higher up) when it tries to add a 
child that already exists. Node (which IsoContainer extends) have a check for 
this case and then does nothing, IsoContainer on the other hand will proceed as 
usual even if the child isn't new.

My simple fix was to remove the check that Node does. So if you add a node 
which already is a child then it will first be removed and then added again.

Original issue reported on code.google.com by tala...@gmail.com on 20 Jul 2011 at 11:46