2
0
Эх сурвалжийг харах

prevent multi remove() bug

ncannasse 10 жил өмнө
parent
commit
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;
+		}
 	}
 
 }