Browse Source

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

ncannasse 11 năm trước cách đây
mục cha
commit
1732262feb
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  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 = [];