Return exit code from gio::Application::run() from main()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1065>
This commit is contained in:
Sebastian Dröge 2023-01-27 18:58:59 +02:00 committed by Sebastian Dröge
parent 62bfc545d3
commit c7209dbd4f
4 changed files with 10 additions and 8 deletions

View file

@ -196,7 +196,7 @@ fn create_ui(app: &gtk::Application) {
});
}
fn main() {
fn main() -> glib::ExitCode {
gst::init().unwrap();
gtk::init().unwrap();
@ -206,5 +206,5 @@ fn main() {
let app = gtk::Application::new(None::<&str>, gio::ApplicationFlags::FLAGS_NONE);
app.connect_activate(create_ui);
app.run();
app.run()
}

View file

@ -158,7 +158,7 @@ fn create_window(app: &gtk::Application) {
window.show();
}
fn main() {
fn main() -> glib::ExitCode {
let app = gtk::Application::new(
Some("gtk-plugins-rs.gtk-livesync"),
gio::ApplicationFlags::FLAGS_NONE,
@ -171,5 +171,5 @@ fn main() {
});
app.connect_activate(create_window);
app.run();
app.run()
}

View file

@ -326,7 +326,7 @@ fn create_ui(app: &gtk::Application) {
});
}
fn main() {
fn main() -> glib::ExitCode {
gst::init().unwrap();
gtk::init().unwrap();
@ -336,5 +336,5 @@ fn main() {
let app = gtk::Application::new(None::<&str>, gio::ApplicationFlags::FLAGS_NONE);
app.connect_activate(create_ui);
app.run();
app.run()
}

View file

@ -141,7 +141,7 @@ fn create_ui(app: &gtk::Application) {
});
}
fn main() {
fn main() -> glib::ExitCode {
gst::init().unwrap();
gtk::init().unwrap();
@ -150,9 +150,11 @@ fn main() {
let app = gtk::Application::new(None::<&str>, gio::ApplicationFlags::FLAGS_NONE);
app.connect_activate(create_ui);
app.run();
let res = app.run();
unsafe {
gst::deinit();
}
res
}