close #333784 unref the result of gst_pad_get_parent() by: Christophe Fergeau.
[platform/upstream/gstreamer.git] / sys / osxaudio / gstosxaudiosrc.c
index 94877ef..6d0331c 100644 (file)
@@ -159,11 +159,13 @@ gst_osxaudiosrc_get (GstPad * pad)
   if (readbytes < 0) {
     gst_buffer_unref (buf);
     GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ERROR_SYSTEM);
+    gst_object_unref (src);
     return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
   }
 
   if (readbytes == 0) {
     gst_buffer_unref (buf);
+    gst_object_unref (src);
     return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
   }
 
@@ -174,6 +176,8 @@ gst_osxaudiosrc_get (GstPad * pad)
 
   GST_DEBUG ("pushed buffer from soundcard of %ld bytes", readbytes);
 
+  gst_object_unref (src);
+
   return GST_DATA (buf);
 }