Pārlūkot izejas kodu

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

ncannasse 11 gadi atpakaļ
vecāks
revīzija
1732262feb
1 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  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 = [];