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:
1 parent
9254331ee5
commit
6db3dc07f1
1 file changed
+4
-2
@@ -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();
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
Reference in new issue
Block a user