From: Sangjung Woo Date: Wed, 15 Jul 2020 09:36:05 +0000 (+0900) Subject: [Demux] Bugfix for set_property function X-Git-Tag: accepted/tizen/unified/20200723.161155~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6449d45e617e5f79ca4093421f00f10d43753e58;p=platform%2Fupstream%2Fnnstreamer.git [Demux] Bugfix for set_property function If `tensorpick` property of demux element is set twice by calling g_object_set() function, the previous value should be removed and new one should be written. However, the value is appended and it can make a problem. This patch fixes this bug. Signed-off-by: Sangjung Woo --- diff --git a/gst/nnstreamer/tensor_demux/gsttensordemux.c b/gst/nnstreamer/tensor_demux/gsttensordemux.c index ccf0c26..9fce6d3 100644 --- a/gst/nnstreamer/tensor_demux/gsttensordemux.c +++ b/gst/nnstreamer/tensor_demux/gsttensordemux.c @@ -546,6 +546,12 @@ gst_tensor_demux_set_property (GObject * object, guint prop_id, const gchar *param = g_value_get_string (value); gchar **strv = g_strsplit_set (param, ",.;/", -1); gint num = g_strv_length (strv); + + /* Before setting the new Tensor Pick data, the existing one should be removed. */ + if (filter->tensorpick) { + g_list_free (filter->tensorpick); + filter->tensorpick = NULL; + } for (i = 0; i < num; i++) { val = g_ascii_strtoll (strv[i], NULL, 10); filter->tensorpick =