From 0028d3df9292197cadfd3bb37a91e9b37710ff30 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 12 Dec 2022 15:29:32 +0100 Subject: [PATCH] eframe: App::on_exit is no longer available for wasm32 It was never called in wasm32, so no need to have it there --- crates/eframe/src/epi.rs | 2 ++ crates/eframe/src/web/backend.rs | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/eframe/src/epi.rs b/crates/eframe/src/epi.rs index 228a005d..3659160e 100644 --- a/crates/eframe/src/epi.rs +++ b/crates/eframe/src/epi.rs @@ -125,12 +125,14 @@ pub trait App { /// /// To get a [`glow`] context you need to compile with the `glow` feature flag, /// and run eframe with the glow backend. + #[cfg(not(target_arch = "wasm32"))] #[cfg(feature = "glow")] fn on_exit(&mut self, _gl: Option<&glow::Context>) {} /// Called once on shutdown, after [`Self::save`]. /// /// If you need to abort an exit use [`Self::on_close_event`]. + #[cfg(not(target_arch = "wasm32"))] #[cfg(not(feature = "glow"))] fn on_exit(&mut self) {} diff --git a/crates/eframe/src/web/backend.rs b/crates/eframe/src/web/backend.rs index e939995d..4cc08020 100644 --- a/crates/eframe/src/web/backend.rs +++ b/crates/eframe/src/web/backend.rs @@ -1,8 +1,7 @@ use egui::{ mutex::{Mutex, MutexGuard}, - TexturesDelta, + pos2, Color32, TexturesDelta, }; -pub use egui::{pos2, Color32}; use crate::{epi, App};