From 08bce008b0a38d5994f926f2a1e61be4541e444d Mon Sep 17 00:00:00 2001
From: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date: Fri, 13 Jan 2012 10:25:22 +0000
Subject: [PATCH] rsvgoverlay: fix adapter leak

---
 ext/rsvg/gstrsvgoverlay.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/ext/rsvg/gstrsvgoverlay.c b/ext/rsvg/gstrsvgoverlay.c
index 121d4d252b..42de199f75 100644
--- a/ext/rsvg/gstrsvgoverlay.c
+++ b/ext/rsvg/gstrsvgoverlay.c
@@ -123,6 +123,8 @@ static GstStaticPadTemplate data_sink_template =
 GST_BOILERPLATE (GstRsvgOverlay, gst_rsvg_overlay, GstVideoFilter,
     GST_TYPE_VIDEO_FILTER);
 
+static void gst_rsvg_overlay_finalize (GObject * object);
+
 static void
 gst_rsvg_overlay_set_svg_data (GstRsvgOverlay * overlay, const gchar * data,
     gboolean consider_as_filename)
@@ -466,6 +468,7 @@ gst_rsvg_overlay_class_init (GstRsvgOverlayClass * klass)
 
   gobject_class->set_property = gst_rsvg_overlay_set_property;
   gobject_class->get_property = gst_rsvg_overlay_get_property;
+  gobject_class->finalize = gst_rsvg_overlay_finalize;
 
   g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DATA,
       g_param_spec_string ("data", "data", "SVG data.", "",
@@ -541,3 +544,13 @@ gst_rsvg_overlay_init (GstRsvgOverlay * overlay, GstRsvgOverlayClass * klass)
       GST_DEBUG_FUNCPTR (gst_rsvg_overlay_data_sink_event));
   gst_element_add_pad (GST_ELEMENT (overlay), overlay->data_sinkpad);
 }
+
+static void
+gst_rsvg_overlay_finalize (GObject * object)
+{
+  GstRsvgOverlay *overlay = GST_RSVG_OVERLAY (object);
+
+  g_object_unref (overlay->adapter);
+
+  G_OBJECT_CLASS (parent_class)->finalize (object);
+}