mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-27 18:50:48 +00:00
wpesrc: fix a memory leak of the bytes
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>
This commit is contained in:
parent
356fee4dd6
commit
da18a8d93d
1 changed files with 5 additions and 2 deletions
|
@ -405,10 +405,13 @@ gst_wpe_src_configure_web_view (GstWpeSrc * src, WebKitWebView * webview)
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue