diff --git a/examples/src/bin/gtksink.rs b/examples/src/bin/gtksink.rs index 61e8ad874..d14e87a64 100644 --- a/examples/src/bin/gtksink.rs +++ b/examples/src/bin/gtksink.rs @@ -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 } diff --git a/examples/src/bin/gtkvideooverlay.rs b/examples/src/bin/gtkvideooverlay.rs index 5662c0991..2846bb703 100644 --- a/examples/src/bin/gtkvideooverlay.rs +++ b/examples/src/bin/gtkvideooverlay.rs @@ -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 }