wpe: Properly free property fields

The set location (in two places) and loaded bytes were not freed when
the element is destroyed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2222>
This commit is contained in:
Jan Alexander Steffens (heftig) 2021-05-06 18:37:45 +02:00 committed by GStreamer Marge Bot
parent 950d5eedf9
commit c9a04ca979
2 changed files with 6 additions and 2 deletions

View file

@ -294,12 +294,14 @@ WPEView::WPEView(WebKitWebContext* web_context, GstWpeSrc* src, GstGLContext* co
gst_wpe_src_configure_web_view(src, webkit.view);
const gchar* location;
gchar* location;
gboolean drawBackground = TRUE;
g_object_get(src, "location", &location, "draw-background", &drawBackground, nullptr);
setDrawBackground(drawBackground);
if (location)
if (location) {
loadUriUnlocked(location);
g_free(location);
}
}
WPEView::~WPEView()

View file

@ -666,6 +666,8 @@ gst_wpe_src_finalize (GObject * object)
{
GstWpeSrc *src = GST_WPE_SRC (object);
g_free (src->location);
g_clear_pointer (&src->bytes, g_bytes_unref);
g_mutex_clear (&src->lock);
G_OBJECT_CLASS (parent_class)->finalize (object);