Fix 3: optimize shutdown times

This commit is contained in:
Sebastian 2026-06-24 12:10:20 +02:00 • committed by Hakan Seven
commit a93d425002
4 changed files with 128 additions and 21 deletions

View file

@ -2139,6 +2139,16 @@ pub fn run() -> iced::Result {
.run()
}
impl Drop for OpenCADStudio {
fn drop(&mut self) {
// Kill plugin runner processes as soon as the application state is
// dropped, instead of waiting for the thread-local manager destructor.
// This makes host shutdown deterministic and fast on every exit path.
#[cfg(not(target_arch = "wasm32"))]
crate::plugin::external::shutdown_plugins();
}
}
/// Single-window entry for the web (wasm) build. Uses `iced::application`
/// instead of `iced::daemon`: the browser canvas is the only window, so the
/// main-window view is rendered directly and the manager/dialog windows are