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:
Taym Haddadi 2024-08-06 12:01:33 +02:00 committed by GitHub
parent 28430bad0e
commit 3800922cde
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 28 additions and 13 deletions

View file

@ -368,7 +368,10 @@ impl WebGLThread {
WebGLMsg::SwapBuffers(swap_ids, sender, sent_time) => {
self.handle_swap_buffers(swap_ids, sender, sent_time);
},
WebGLMsg::Exit => {
WebGLMsg::Exit(sender) => {
if let Err(e) = sender.send(()) {
warn!("Failed to send response to WebGLMsg::Exit ({e})");
}
return true;
},
}