Fix retain cycle in on_app_quit (#50985)

Updates #50970

While investigating the executor shutdown code, Claude noticed that we
never
actually drop the app because of a reference cycle.

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin authored and GitHub committed 2026-03-07 04:15:23 +00:00
1 parent 9254331ee5
commit 6db3dc07f1
1 file changed
+4 -2
+4 -2
View File
@@ -744,9 +744,11 @@ impl App {
}));
platform.on_quit(Box::new({
let cx = app.clone();
let cx = Rc::downgrade(&app);
move || {
cx.borrow_mut().shutdown();
if let Some(cx) = cx.upgrade() {
cx.borrow_mut().shutdown();
}
}
}));