This commit is contained in:
Conrad Irwin 2025-08-11 22:47:56 -06:00
parent 155e29f5d9
commit d2da9108cd

View file

@ -113,7 +113,7 @@ impl AppCell {
let futures = futures::future::join_all(futures);
futures::pin_mut!(futures);
let mut start = std::time::Instant::now();
while dbg!(start.elapsed() < SHUTDOWN_TIMEOUT) {
while start.elapsed() < SHUTDOWN_TIMEOUT {
match futures.as_mut().poll(&mut future_cx) {
Poll::Pending => {
executor.tick();
@ -420,32 +420,6 @@ impl App {
app
}
/// Quit the application gracefully. Handlers registered with [`Context::on_app_quit`]
/// will be given 100ms to complete before exiting.
pub fn shutdown_old(&mut self) {
let mut futures = Vec::new();
for observer in self.quit_observers.remove(&()) {
futures.push(observer(self));
}
self.windows.clear();
self.window_handles.clear();
self.flush_effects();
self.quitting = true;
let futures = futures::future::join_all(futures);
if self
.background_executor
.block_with_timeout(SHUTDOWN_TIMEOUT, futures)
.is_err()
{
log::error!("timed out waiting on app_will_quit");
}
self.quitting = false;
}
/// Get the id of the current keyboard layout
pub fn keyboard_layout(&self) -> &dyn PlatformKeyboardLayout {
self.keyboard_layout.as_ref()