# HG changeset patch # User rosfran # Date 1176494630 -3600 # Node ID b81aea41900f37d3cae17df0fa099a8d9af900b1 # Parent 60c1efd70423d8950e4c8bf3146e1af3b744d30b [svn r553] _stop GStreamer's plug-in handler is now doing all the clean-ups. diff -r 60c1efd70423 -r b81aea41900f gst-plugins-mythtv/src/gstmythtvsrc.c --- a/gst-plugins-mythtv/src/gstmythtvsrc.c Fri Apr 13 20:33:36 2007 +0100 +++ b/gst-plugins-mythtv/src/gstmythtvsrc.c Fri Apr 13 21:03:50 2007 +0100 @@ -113,6 +113,8 @@ PROP_GMYTHTV_CHANNEL_NUM }; +static void gst_mythtv_src_clear (GstMythtvSrc *mythtv_src); + static void gst_mythtv_src_finalize (GObject * gobject); static GstFlowReturn gst_mythtv_src_create (GstPushSrc * psrc, @@ -297,37 +299,45 @@ } static void +gst_mythtv_src_clear (GstMythtvSrc *mythtv_src) +{ + + if (mythtv_src->spawn_livetv) { + g_object_unref (mythtv_src->spawn_livetv); + mythtv_src->spawn_livetv = NULL; + } + + if (mythtv_src->file) { + g_object_unref (mythtv_src->file); + mythtv_src->file = NULL; + } + + if (mythtv_src->backend_info) { + g_object_unref (mythtv_src->backend_info); + mythtv_src->backend_info = NULL; + } + + if (mythtv_src->uri_name) { + g_free (mythtv_src->uri_name); + } + + if (mythtv_src->user_agent) { + g_free (mythtv_src->user_agent); + } + + if (mythtv_src->bytes_queue) { + g_byte_array_free (mythtv_src->bytes_queue, TRUE); + mythtv_src->bytes_queue = NULL; + } + +} + +static void gst_mythtv_src_finalize (GObject * gobject) { GstMythtvSrc *this = GST_MYTHTV_SRC (gobject); - if (this->spawn_livetv) { - g_object_unref (this->spawn_livetv); - this->spawn_livetv = NULL; - } - - if (this->file) { - g_object_unref (this->file); - this->file = NULL; - } - - if (this->backend_info) { - g_object_unref (this->backend_info); - this->backend_info = NULL; - } - - if (this->uri_name) { - g_free (this->uri_name); - } - - if (this->user_agent) { - g_free (this->user_agent); - } - - if (this->bytes_queue) { - g_byte_array_free (this->bytes_queue, TRUE); - this->bytes_queue = NULL; - } + gst_mythtv_src_clear (this); G_OBJECT_CLASS (parent_class)->finalize (gobject); } @@ -828,16 +838,11 @@ static gboolean gst_mythtv_src_stop (GstBaseSrc * bsrc) { - GstMythtvSrc *src; + GstMythtvSrc *src = GST_MYTHTV_SRC (bsrc); + + gst_mythtv_src_clear (src); - src = GST_MYTHTV_SRC (bsrc); - - if (src->uri_name) { - g_free (src->uri_name); - src->uri_name = NULL; - } - - src->eos = FALSE; + /* src->eos = FALSE; */ return TRUE; }