From 4ae0168aea9143ac1c98181f4955397e0ce7efd3 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Sat, 22 May 2021 17:36:31 +0200 Subject: [PATCH] examples: gtksink: call gst::deinit() Needed so we can use the leaks tracer. --- examples/src/bin/gtksink.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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(); + } }