Browse Source

added missing onRemove() after drawTo (close #564)

ncannasse 6 năm trước cách đây
mục cha
commit
96ccc67851
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      h2d/Object.hx

+ 4 - 1
h2d/Object.hx

@@ -432,7 +432,10 @@ class Object {
 		var needDispose = s == null;
 		if( s == null ) s = new h2d.Scene();
 		@:privateAccess s.drawImplTo(this, t);
-		if( needDispose ) s.dispose();
+		if( needDispose ) {
+			s.dispose();
+			onRemove();
+		}
 	}
 
 	function draw( ctx : RenderContext ) {