From: Jan Alexander Steffens (heftig) Date: Thu, 6 May 2021 16:37:45 +0000 (+0200) Subject: wpe: Properly free property fields X-Git-Tag: 1.19.3~507^2~449 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c9a04ca979d004114f7df2ceb18bd74d1b191df8;p=platform%2Fupstream%2Fgstreamer.git wpe: Properly free property fields The set location (in two places) and loaded bytes were not freed when the element is destroyed. Part-of: --- diff --git a/ext/wpe/WPEThreadedView.cpp b/ext/wpe/WPEThreadedView.cpp index 051d103..f4588e5 100644 --- a/ext/wpe/WPEThreadedView.cpp +++ b/ext/wpe/WPEThreadedView.cpp @@ -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() diff --git a/ext/wpe/gstwpesrc.cpp b/ext/wpe/gstwpesrc.cpp index 2660ae8..750e354 100644 --- a/ext/wpe/gstwpesrc.cpp +++ b/ext/wpe/gstwpesrc.cpp @@ -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);