rusticl/mesa/context: flush context before destruction

Drivers might still be busy doing things and not properly clean things up.

Fixes a rare crash on applicatione exits with some drivers.

Fixes: 50e981a050 ("rusticl/mesa: add fencing support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29223>
(cherry picked from commit f1662e9bc9)
This commit is contained in:
Karol Herbst 2024-05-15 13:47:42 +02:00 committed by Eric Engestrom
parent 02aa4bb803
commit e0789e1f06
2 changed files with 2 additions and 1 deletions

View file

@ -1214,7 +1214,7 @@
"description": "rusticl/mesa/context: flush context before destruction",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "50e981a0504bf0a94b7cd93105ff250707e6850d",
"notes": null

View file

@ -659,6 +659,7 @@ impl PipeContext {
impl Drop for PipeContext {
fn drop(&mut self) {
self.flush().wait();
unsafe {
self.pipe.as_ref().destroy.unwrap()(self.pipe.as_ptr());
}