Explorar o código

automatically clear graphics buffers when removed from scene (prevent leak)

ncannasse %!s(int64=11) %!d(string=hai) anos
pai
achega
1732262feb
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      h2d/Graphics.hx

+ 5 - 0
h2d/Graphics.hx

@@ -121,6 +121,11 @@ class Graphics extends Drawable {
 		clear();
 	}
 	
+	override function onDelete() {
+		super.onDelete();
+		clear();
+	}
+	
 	public function clear() {
 		content.reset();
 		pts = [];