gtk4: Deactivate the context if we fail to fill_info

Avoid leaving the context activated if we end up erroring out.

Similar to https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3492

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1001>
This commit is contained in:
Jordan Petridis 2022-12-06 20:28:16 +02:00 committed by Sebastian Dröge
parent d9de2d3d7b
commit 37b0dab0e8

View file

@ -670,6 +670,16 @@ impl PaintableSink {
"Failed to fill info on the GL Context: {}",
&err
);
// Deactivate the context upon failure
if let Err(err) = app_ctx_guard.as_ref().unwrap().activate(false) {
gst::error!(
CAT,
imp: self,
"Failed to deactivate the context after failing fill info: {}",
&err
);
}
return Err(err);
}
};