fix: remove foreign toplevel handle too

This commit is contained in:
Aleksandr Kosachev 2026-09-06 19:36:12 +03:00 • committed by Victoria Brekenfeld
parent 6026520bd3
commit 7d1daab7bc

View file

@ -418,6 +418,12 @@ where
handle.closed();
}
}
// Remove the foreign handle too, so new subscribers cannot
// discover a toplevel whose window has already been destroyed.
if let Some(handle) = state.foreign_handle.take() {
self.foreign_toplevel_list.remove_toplevel(&handle);
}
*state = Default::default();
dirty = true;
false
}