Преглед изворни кода

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() {
 	public inline function remove() {
-		batch.delete(this);
+		if( batch != null ) {
+			batch.delete(this);
+			batch = null;
+		}
 	}
 	}
 
 
 }
 }