Skip to content

Commit

Permalink
remove event listeners on Mesh disposal
Browse files Browse the repository at this point in the history
  • Loading branch information
DerSchmale committed Aug 10, 2011
1 parent 2af9905 commit 11a577f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/away3d/entities/Mesh.as
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,14 @@
*/
override public function dispose(deep : Boolean) : void
{
_geometry.removeEventListener(GeometryEvent.BOUNDS_INVALID, onGeometryBoundsInvalid);
_geometry.removeEventListener(GeometryEvent.SUB_GEOMETRY_ADDED, onSubGeometryAdded);
_geometry.removeEventListener(GeometryEvent.SUB_GEOMETRY_REMOVED, onSubGeometryRemoved);
_geometry.removeEventListener(GeometryEvent.ANIMATION_CHANGED, onAnimationChanged);

if (deep) {
_geometry.dispose();

if (_material) {
_material.dispose(true);
material = null;
Expand Down

0 comments on commit 11a577f

Please sign in to comment.