diff --git a/examples/src/bin/gtksink.rs b/examples/src/bin/gtksink.rs index b4fd5ce6d..9e07bf042 100644 --- a/examples/src/bin/gtksink.rs +++ b/examples/src/bin/gtksink.rs @@ -151,8 +151,15 @@ fn main() { gst::init().unwrap(); gtk::init().unwrap(); - 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.run(); + app.connect_activate(create_ui); + app.run(); + } + + // Optional, can be used to detect leaks using the leaks tracer + unsafe { + gst::deinit(); + } }