--- gstreamer-0.10.6_gst_ori/gst/gstpad.c	2006-10-12 10:11:03.000000000 -0400
+++ gstreamer-0.10.6/gst/gstpad.c	2006-10-12 13:30:28.000000000 -0400
@@ -1597,8 +1597,8 @@
       goto done;
     }
     /* if they both have a parent, we check the grandparents */
-    psrc = gst_object_get_parent (psrc);
-    psink = gst_object_get_parent (psink);
+    psrc = GST_OBJECT_PARENT (psrc);
+    psink = GST_OBJECT_PARENT (psink);
 
     if (psrc != psink) {
       /* if they have grandparents but they are not the same */
@@ -1607,10 +1607,6 @@
           GST_PTR_FORMAT, psrc, psink);
       res = FALSE;
     }
-    if (psrc)
-      gst_object_unref (psrc);
-    if (psink)
-      gst_object_unref (psink);
   }
 done:
   return res;
