resindvd: Take a copy of the passed plugin features

Clarify the ownership of the internal plugin feature list by making
a copy of any passed list. Avoids crashes when freeing a passed list,
or leaks caused by not freeing any internally built list.
This commit is contained in:
Jan Schmidt 2009-11-02 11:33:19 +00:00
parent f7b832d19b
commit 570a0bb65c

View file

@ -289,9 +289,10 @@ gst_auto_convert_set_property (GObject * object,
break;
case PROP_FACTORIES:
GST_AUTOCONVERT_LOCK (autoconvert);
if (autoconvert->factories == NULL)
autoconvert->factories = g_value_get_pointer (value);
else
if (autoconvert->factories == NULL) {
GList *factories = g_value_get_pointer (value);
autoconvert->factories = gst_plugin_feature_list_copy (factories);
} else
GST_WARNING_OBJECT (object, "Can not reset factories after they"
" have been set or auto-discovered");
GST_AUTOCONVERT_UNLOCK (autoconvert);