[rygel-gst-0-10-media-engine] Fix critical on unreffing NULL encoder or decoder.



commit 352d436112ae107ea8dec158e141ffe6a146375a
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Wed Jan 9 15:22:02 2013 +0100

    Fix critical on unreffing NULL encoder or decoder.

 src/rygel-gst-transcoder.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/rygel-gst-transcoder.c b/src/rygel-gst-transcoder.c
index 5ee14b0..8afcd86 100644
--- a/src/rygel-gst-transcoder.c
+++ b/src/rygel-gst-transcoder.c
@@ -258,8 +258,13 @@ void rygel_gst_transcoder_finalize (GObject* obj) {
 
   self = RYGEL_GST_TRANSCODER (obj);
   g_free (self->priv->preset);
-  gst_object_unref (self->priv->decoder);
-  gst_object_unref (self->priv->encoder);
+  /* TODO: Move it to dispose. */
+  if (self->priv->decoder) {
+    gst_object_unref (self->priv->decoder);
+  }
+  if (self->priv->encoder) {
+    gst_object_unref (self->priv->encoder);
+  }
 
   G_OBJECT_CLASS (rygel_gst_transcoder_parent_class)->finalize (obj);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]