forked from mirrors/gstreamer-rs
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.
|
// Initialize gstreamer and the gtk widget toolkit libraries.
|
||||||
gst::init().unwrap();
|
gst::init().unwrap();
|
||||||
gtk::init().unwrap();
|
gtk::init().unwrap();
|
||||||
|
|
||||||
{
|
let res = {
|
||||||
let app = gtk::Application::new(None, gio::ApplicationFlags::FLAGS_NONE);
|
let app = gtk::Application::new(None, gio::ApplicationFlags::FLAGS_NONE);
|
||||||
|
|
||||||
app.connect_activate(create_ui);
|
app.connect_activate(create_ui);
|
||||||
app.run();
|
app.run()
|
||||||
}
|
};
|
||||||
|
|
||||||
// Optional, can be used to detect leaks using the leaks tracer
|
// Optional, can be used to detect leaks using the leaks tracer
|
||||||
unsafe {
|
unsafe {
|
||||||
gst::deinit();
|
gst::deinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
res
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,7 +259,7 @@ fn create_ui(app: >k::Application) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() -> glib::ExitCode {
|
||||||
#[cfg(not(unix))]
|
#[cfg(not(unix))]
|
||||||
{
|
{
|
||||||
println!("Add support for target platform");
|
println!("Add support for target platform");
|
||||||
|
@ -270,15 +270,17 @@ fn main() {
|
||||||
gst::init().unwrap();
|
gst::init().unwrap();
|
||||||
gtk::init().unwrap();
|
gtk::init().unwrap();
|
||||||
|
|
||||||
{
|
let res = {
|
||||||
let app = gtk::Application::new(None, gio::ApplicationFlags::FLAGS_NONE);
|
let app = gtk::Application::new(None, gio::ApplicationFlags::FLAGS_NONE);
|
||||||
|
|
||||||
app.connect_activate(create_ui);
|
app.connect_activate(create_ui);
|
||||||
app.run();
|
app.run()
|
||||||
}
|
};
|
||||||
|
|
||||||
// Optional, can be used to detect leaks using the leaks tracer
|
// Optional, can be used to detect leaks using the leaks tracer
|
||||||
unsafe {
|
unsafe {
|
||||||
gst::deinit();
|
gst::deinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
res
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue