From f671026f117a07eb5835a27d2dc4d7c3ab216be6 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Mon, 25 Sep 2017 15:14:45 +0200 Subject: [PATCH] alsamidisrc: Prevent Valgrind from reporting cached config as memory leaks See http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=MEMORY-LEAK;hb=HEAD This allows to have cleaner Valgrind reports about alsamidisrc and make it easier to spot actual problems. https://bugzilla.gnome.org/show_bug.cgi?id=787683 --- ext/alsa/gstalsamidisrc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/alsa/gstalsamidisrc.c b/ext/alsa/gstalsamidisrc.c index f80cf79..2423826 100644 --- a/ext/alsa/gstalsamidisrc.c +++ b/ext/alsa/gstalsamidisrc.c @@ -94,6 +94,12 @@ init_seq (GstAlsaMidiSrc * alsamidisrc) goto error; } + /* + * Prevent Valgrind from reporting cached configuration as memory leaks, see: + * http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=MEMORY-LEAK;hb=HEAD + */ + snd_config_update_free_global (); + ret = snd_seq_set_client_name (alsamidisrc->seq, DEFAULT_CLIENT_NAME); if (ret < 0) { GST_ERROR_OBJECT (alsamidisrc, "Cannot set client name - %s", -- 2.7.4