소스 검색

prevent multi remove() bug

ncannasse 10 년 전
부모
커밋
566330635c
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      h2d/SpriteBatch.hx

+ 4 - 1
h2d/SpriteBatch.hx

@@ -51,7 +51,10 @@ class BatchElement {
 	}
 
 	public inline function remove() {
-		batch.delete(this);
+		if( batch != null ) {
+			batch.delete(this);
+			batch = null;
+		}
 	}
 
 }