fix(android): properly destroy windows on suspend

This commit is contained in:
Chance 2025-04-18 14:06:38 -04:00 committed by BitSyndicate
parent d227580b92
commit 81762b5889
Signed by: bitsyndicate
GPG key ID: 443E4198D6BBA6DE

View file

@ -493,6 +493,9 @@ impl ApplicationHandler for App<'_> {
self.windows.insert(window_id, window_ctx);
}
}
fn suspended(&mut self, _event_loop: &ActiveEventLoop) {
self.windows.clear();
}
}
pub fn main() -> Result<(), terminator::Terminator> {
let config = LoggerConfig::default()
@ -507,6 +510,10 @@ pub fn main() -> Result<(), terminator::Terminator> {
{
_main()
}
#[cfg(target_os = "android")]
{
Ok(())
}
}
pub fn run_app(event_loop: winit::event_loop::EventLoop<()>) -> Result<(), terminator::Terminator> {
let mut app = App::new();