Index: gst/schedulers/gstoptimalscheduler.c
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/schedulers/Attic/gstoptimalscheduler.c,v
retrieving revision 1.109.2.1
diff -u -r1.109.2.1 gstoptimalscheduler.c
--- gst/schedulers/gstoptimalscheduler.c	22 Apr 2005 12:30:00 -0000	1.109.2.1
+++ gst/schedulers/gstoptimalscheduler.c	19 Jun 2005 15:36:08 -0000
@@ -1556,6 +1556,7 @@
   data = NULL;
   disabled = FALSE;
 
+  gst_object_ref (GST_OBJECT (srcpad));
   GST_OPT_LOCK (osched);
   do {
     GST_LOG ("scheduling upstream group %p to fill datapen", group);
@@ -1616,6 +1617,7 @@
 
   GST_LOG ("get handler, returning data %p, queue length %d",
       data, g_list_length (GST_PAD_DATALIST (srcpad)));
+  gst_object_unref (GST_OBJECT (srcpad));
 
   return data;
 }
