mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Fix panic in Webrender during shutdown (#32897)
* Fix panic in webrender during shutdown Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Pass webgl_threads_sender to WebGLThreads::exit Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * follow the naming convention and use sender instead of webgl_threads_sender Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Avoid deadlock when webgl_threads is None Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Use tuple matching for webgl_threads and webgl_threads_receiver Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Remove unused _webgl_threads_sender Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
This commit is contained in:
parent
28430bad0e
commit
3800922cde
4 changed files with 28 additions and 13 deletions
|
@ -2644,6 +2644,7 @@ where
|
|||
ipc::channel().expect("Failed to create IPC channel!");
|
||||
let (storage_ipc_sender, storage_ipc_receiver) =
|
||||
ipc::channel().expect("Failed to create IPC channel!");
|
||||
let mut webgl_threads_receiver = None;
|
||||
|
||||
debug!("Exiting core resource threads.");
|
||||
if let Err(e) = self
|
||||
|
@ -2710,9 +2711,12 @@ where
|
|||
}
|
||||
|
||||
if let Some(webgl_threads) = self.webgl_threads.as_ref() {
|
||||
let (sender, receiver) = ipc::channel().expect("Failed to create IPC channel!");
|
||||
webgl_threads_receiver = Some(receiver);
|
||||
debug!("Exiting WebGL thread.");
|
||||
if let Err(e) = webgl_threads.exit() {
|
||||
warn!("Exit WebGL Thread failed ({})", e);
|
||||
|
||||
if let Err(e) = webgl_threads.exit(sender) {
|
||||
warn!("Exit WebGL Thread failed ({e})");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2733,6 +2737,14 @@ where
|
|||
if let Err(e) = storage_ipc_receiver.recv() {
|
||||
warn!("Exit storage thread failed ({:?})", e);
|
||||
}
|
||||
if self.webgl_threads.is_some() {
|
||||
if let Err(e) = webgl_threads_receiver
|
||||
.expect("webgl_threads_receiver to be Some")
|
||||
.recv()
|
||||
{
|
||||
warn!("Exit WebGL thread failed ({:?})", e);
|
||||
}
|
||||
}
|
||||
|
||||
debug!("Asking compositor to complete shutdown.");
|
||||
self.compositor_proxy.send(CompositorMsg::ShutdownComplete);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue