mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-29 15:01:07 +00:00
gtk4: Reset app context and display if GL context creation fails
No need to keep them around and that way we either have all 3 values set or none of them. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1032>
This commit is contained in:
parent
4ee70913bd
commit
9ec06199b1
1 changed files with 8 additions and 0 deletions
|
@ -678,6 +678,8 @@ impl PaintableSink {
|
||||||
Ok(_) => gst::info!(CAT, imp: self, "Successfully activated GL Context."),
|
Ok(_) => gst::info!(CAT, imp: self, "Successfully activated GL Context."),
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
gst::error!(CAT, imp: self, "Failed to activate GL context",);
|
gst::error!(CAT, imp: self, "Failed to activate GL context",);
|
||||||
|
*app_ctx_guard = None;
|
||||||
|
*display_guard = None;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -696,12 +698,16 @@ impl PaintableSink {
|
||||||
"Failed to deactivate the context after failing fill info",
|
"Failed to deactivate the context after failing fill info",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
*app_ctx_guard = None;
|
||||||
|
*display_guard = None;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if app_ctx.activate(false).is_err() {
|
if app_ctx.activate(false).is_err() {
|
||||||
gst::error!(CAT, imp: self, "Failed to deactivate GL context",);
|
gst::error!(CAT, imp: self, "Failed to deactivate GL context",);
|
||||||
|
*app_ctx_guard = None;
|
||||||
|
*display_guard = None;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -720,6 +726,8 @@ impl PaintableSink {
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
gst::error!(CAT, imp: self, "Could not create GL context: {err}");
|
gst::error!(CAT, imp: self, "Could not create GL context: {err}");
|
||||||
|
*app_ctx_guard = None;
|
||||||
|
*display_guard = None;
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue