diff --git a/egui_demo_lib/src/apps/custom_3d.rs b/egui_demo_lib/src/apps/custom_3d.rs index e24bb5c2..01a8a870 100644 --- a/egui_demo_lib/src/apps/custom_3d.rs +++ b/egui_demo_lib/src/apps/custom_3d.rs @@ -47,6 +47,10 @@ impl epi::App for Custom3dApp { }); }); } + + fn on_exit(&mut self, gl: &glow::Context) { + self.rotating_triangle.lock().destroy(gl); + } } impl Custom3dApp { @@ -166,8 +170,6 @@ impl RotatingTriangle { } } - // TODO: figure out how to call this in a nice way - #[allow(unused)] fn destroy(self, gl: &glow::Context) { use glow::HasContext as _; unsafe { diff --git a/egui_demo_lib/src/wrap_app.rs b/egui_demo_lib/src/wrap_app.rs index 324e183a..e23d212e 100644 --- a/egui_demo_lib/src/wrap_app.rs +++ b/egui_demo_lib/src/wrap_app.rs @@ -132,6 +132,15 @@ impl epi::App for WrapApp { self.ui_file_drag_and_drop(ctx); } + + fn on_exit(&mut self, gl: &glow::Context) { + self.apps.demo.on_exit(gl); + self.apps.easy_mark_editor.on_exit(gl); + self.apps.http.on_exit(gl); + self.apps.clock.on_exit(gl); + self.apps.color_test.on_exit(gl); + self.apps.custom_3d.on_exit(gl); + } } impl WrapApp {