From 1c0c8f788c8125c90a097e5241b5e8fe2518d1d2 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 5 Jan 2025 23:24:57 +0100 Subject: a --- client/src/window.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'client/src/window.rs') diff --git a/client/src/window.rs b/client/src/window.rs index 5f2e7f8..2219bbc 100644 --- a/client/src/window.rs +++ b/client/src/window.rs @@ -43,7 +43,7 @@ impl ApplicationHandler for WindowState { WindowEvent::Resized(size) => { sta.renderer.resize(size.width, size.height); } - WindowEvent::RedrawRequested => sta.renderer.draw().unwrap(), + WindowEvent::RedrawRequested => sta.renderer.draw(&sta.tree).unwrap(), WindowEvent::CloseRequested => { event_loop.exit(); } @@ -59,3 +59,12 @@ impl ApplicationHandler for WindowState { } } } + +impl Drop for WindowState { + fn drop(&mut self) { + if let Some((win, sta)) = self.window.take() { + drop(sta); + drop(win) + } + } +} -- cgit v1.2.3-70-g09d2