tauri-apps / tao

refactor(android): call WindowEvent::Destroyed on activity destroy (#1148)
currently the Rust lifecycle is partially tied to the Android activity lifecycle: - when the activity is created we initialize the event loop: https://github.com/tauri-apps/wry/blob/84b0ec2e35236e0b43150e37b55c7b6d2e5cf7e9/src/android/kotlin/WryActivity.kt#L61 https://github.com/tauri-apps/tao/blob/fda48e80ef0600079666c19146eb01bdfc4dd3c4/src/platform_impl/android/ndk_glue.rs#L196 - on destroy we are not doing anything in particular now, but we should let the app exit the event loop so it can properly restart when the activity gets recreated to reproduce this, open a Tauri app and press the back button - it will destroy the activity, and reopening the app will crash due to some global state trying to reinitialize (like a log plugin initialization or any other global singleton values) closes https://github.com/tauri-apps/tauri/issues/13568
Lucas Fernandes Nogueira Lucas Fernandes Nogueira committed on Oct 16, 2025, 10:35 AM
Showing 2 changed files +16 additions -0 deletions
Browse files at this commit โ†’