mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
Keep winit::Window
alive until all rendering contexts are destroyed (#37239)
Dropping the window while the rendering contexts are still around causes a segmentation fault during shutdown. This is a very fragile change. I added comments to hopes of making regressions less likely. Testing: I don't think we have a way to write tests for this change since it requires a wayland system ): Fixes: https://github.com/servo/servo/issues/36711 Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
c94605b13e
commit
7439fa18d3
2 changed files with 10 additions and 2 deletions
|
@ -42,13 +42,17 @@ pub struct App {
|
|||
preferences: Preferences,
|
||||
servoshell_preferences: ServoShellPreferences,
|
||||
suspended: Cell<bool>,
|
||||
windows: HashMap<WindowId, Rc<dyn WindowPortsMethods>>,
|
||||
minibrowser: Option<Minibrowser>,
|
||||
waker: Box<dyn EventLoopWaker>,
|
||||
initial_url: ServoUrl,
|
||||
t_start: Instant,
|
||||
t: Instant,
|
||||
state: AppState,
|
||||
|
||||
// This is the last field of the struct to ensure that windows are dropped *after* all other
|
||||
// references to the relevant rendering contexts have been destroyed.
|
||||
// (https://github.com/servo/servo/issues/36711)
|
||||
windows: HashMap<WindowId, Rc<dyn WindowPortsMethods>>,
|
||||
}
|
||||
|
||||
/// Action to be taken by the caller of [`App::handle_events`].
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue