free the previous GBytes if load-bytes is called multiple times
before view creation.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1663>
static void
gst_wpe_src_load_bytes (GstWpeSrc * src, GBytes * bytes)
{
- if (src->view && GST_STATE (GST_ELEMENT_CAST (src)) > GST_STATE_NULL)
+ if (src->view && GST_STATE (GST_ELEMENT_CAST (src)) > GST_STATE_NULL) {
src->view->loadData (bytes);
- else
+ } else {
+ if (src->bytes)
+ g_bytes_unref (src->bytes);
src->bytes = g_bytes_ref (bytes);
+ }
}
static gboolean