--- gst-plugins-base/sys/ximage/ximagesink.c	2007-09-08 17:28:04.833409622 +0200
+++ gst-plugins-base/sys/ximage/ximagesink.c.mod	2007-09-08 17:41:45.821159189 +0200
@@ -180,6 +180,8 @@ static GstVideoSinkClass *parent_class =
 
 /* ximage buffers */
 
+static GstBufferClass *ximage_buffer_parent_class = NULL;
+
 #define GST_TYPE_XIMAGE_BUFFER (gst_ximage_buffer_get_type())
 
 #define GST_IS_XIMAGE_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_XIMAGE_BUFFER))
@@ -236,6 +238,10 @@ gst_ximage_buffer_finalize (GstXImageBuf
     recycled = TRUE;
   }
 
+  if (!recycled)
+    GST_MINI_OBJECT_CLASS (ximage_buffer_parent_class)->
+        finalize (GST_MINI_OBJECT (ximage));
+
 beach:
   return;
 }
@@ -263,6 +269,8 @@ gst_ximage_buffer_class_init (gpointer g
 {
   GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (g_class);
 
+  ximage_buffer_parent_class = g_type_class_peek_parent (g_class);
+
   mini_object_class->finalize = (GstMiniObjectFinalizeFunction)
       gst_ximage_buffer_finalize;
 }
