From 10dd3a21776d88394c06d9725993a4673d467756 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 20 Jul 2016 11:43:51 +0200 Subject: [PATCH] playback/player: Call gst_deinit() in all applications at the end of main() Needed to be able to track leaks using valgrind or the leaks tracer. --- playback/player/gst-play/gst-play.c | 1 + playback/player/gtk/gtk-play.c | 1 + playback/player/qt/main.cpp | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/playback/player/gst-play/gst-play.c b/playback/player/gst-play/gst-play.c index 46f6d62a71..bd21bd27af 100644 --- a/playback/player/gst-play/gst-play.c +++ b/playback/player/gst-play/gst-play.c @@ -768,5 +768,6 @@ main (int argc, char **argv) play_free (play); g_print ("\n"); + gst_deinit (); return 0; } diff --git a/playback/player/gtk/gtk-play.c b/playback/player/gtk/gtk-play.c index 6bc8fd8ad7..7f9e588cb1 100644 --- a/playback/player/gtk/gtk-play.c +++ b/playback/player/gtk/gtk-play.c @@ -1910,5 +1910,6 @@ main (gint argc, gchar ** argv) status = g_application_run (G_APPLICATION (app), argc, argv);; g_object_unref (app); + gst_deinit (); return status; } diff --git a/playback/player/qt/main.cpp b/playback/player/qt/main.cpp index 4ef6b64f79..9a8adf6150 100644 --- a/playback/player/qt/main.cpp +++ b/playback/player/qt/main.cpp @@ -30,6 +30,7 @@ int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); + int result; QCommandLineParser parser; parser.setApplicationDescription("GstPlayer"); @@ -70,5 +71,8 @@ int main(int argc, char *argv[]) if (!media_files.isEmpty()) player->setPlaylist(media_files); - return app.exec(); + result = app.exec(); + + gst_deinit (); + return result; }