xeolabs / xeogl

A WebGL-based 3D engine for technical visualization. Not actively maintained.
http://xeogl.org
Other
1.15k stars 264 forks source link

Clone the _childList before destroying children. #264

Closed bradwerth closed 6 years ago

bradwerth commented 6 years ago

When Object._destroy() iterates the _childList and calls destroy() on each, it triggers a call to removeChild() which will modify the _childList and cause iteration problems. This change avoids that by cloning the _childList before iterating it.