mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-23 08:36:31 +00:00
Return exit code from gio::Application::run()
from main()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1208>
This commit is contained in:
parent
5f05f7ec05
commit
a7f670df7a
2 changed files with 12 additions and 8 deletions
|
@ -158,20 +158,22 @@ fn create_ui(app: >k::Application) {
|
|||
});
|
||||
}
|
||||
|
||||
fn main() {
|
||||
fn main() -> glib::ExitCode {
|
||||
// Initialize gstreamer and the gtk widget toolkit libraries.
|
||||
gst::init().unwrap();
|
||||
gtk::init().unwrap();
|
||||
|
||||
{
|
||||
let res = {
|
||||
let app = gtk::Application::new(None, gio::ApplicationFlags::FLAGS_NONE);
|
||||
|
||||
app.connect_activate(create_ui);
|
||||
app.run();
|
||||
}
|
||||
app.run()
|
||||
};
|
||||
|
||||
// Optional, can be used to detect leaks using the leaks tracer
|
||||
unsafe {
|
||||
gst::deinit();
|
||||
}
|
||||
|
||||
res
|
||||
}
|
||||
|
|
|
@ -259,7 +259,7 @@ fn create_ui(app: >k::Application) {
|
|||
});
|
||||
}
|
||||
|
||||
fn main() {
|
||||
fn main() -> glib::ExitCode {
|
||||
#[cfg(not(unix))]
|
||||
{
|
||||
println!("Add support for target platform");
|
||||
|
@ -270,15 +270,17 @@ fn main() {
|
|||
gst::init().unwrap();
|
||||
gtk::init().unwrap();
|
||||
|
||||
{
|
||||
let res = {
|
||||
let app = gtk::Application::new(None, gio::ApplicationFlags::FLAGS_NONE);
|
||||
|
||||
app.connect_activate(create_ui);
|
||||
app.run();
|
||||
}
|
||||
app.run()
|
||||
};
|
||||
|
||||
// Optional, can be used to detect leaks using the leaks tracer
|
||||
unsafe {
|
||||
gst::deinit();
|
||||
}
|
||||
|
||||
res
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue