[svn r553] _stop GStreamer's plug-in handler is now doing all the clean-ups.
1.1 --- a/gst-plugins-mythtv/src/gstmythtvsrc.c Fri Apr 13 20:33:36 2007 +0100
1.2 +++ b/gst-plugins-mythtv/src/gstmythtvsrc.c Fri Apr 13 21:03:50 2007 +0100
1.3 @@ -113,6 +113,8 @@
1.4 PROP_GMYTHTV_CHANNEL_NUM
1.5 };
1.6
1.7 +static void gst_mythtv_src_clear (GstMythtvSrc *mythtv_src);
1.8 +
1.9 static void gst_mythtv_src_finalize (GObject * gobject);
1.10
1.11 static GstFlowReturn gst_mythtv_src_create (GstPushSrc * psrc,
1.12 @@ -297,37 +299,45 @@
1.13 }
1.14
1.15 static void
1.16 +gst_mythtv_src_clear (GstMythtvSrc *mythtv_src)
1.17 +{
1.18 +
1.19 + if (mythtv_src->spawn_livetv) {
1.20 + g_object_unref (mythtv_src->spawn_livetv);
1.21 + mythtv_src->spawn_livetv = NULL;
1.22 + }
1.23 +
1.24 + if (mythtv_src->file) {
1.25 + g_object_unref (mythtv_src->file);
1.26 + mythtv_src->file = NULL;
1.27 + }
1.28 +
1.29 + if (mythtv_src->backend_info) {
1.30 + g_object_unref (mythtv_src->backend_info);
1.31 + mythtv_src->backend_info = NULL;
1.32 + }
1.33 +
1.34 + if (mythtv_src->uri_name) {
1.35 + g_free (mythtv_src->uri_name);
1.36 + }
1.37 +
1.38 + if (mythtv_src->user_agent) {
1.39 + g_free (mythtv_src->user_agent);
1.40 + }
1.41 +
1.42 + if (mythtv_src->bytes_queue) {
1.43 + g_byte_array_free (mythtv_src->bytes_queue, TRUE);
1.44 + mythtv_src->bytes_queue = NULL;
1.45 + }
1.46 +
1.47 +}
1.48 +
1.49 +static void
1.50 gst_mythtv_src_finalize (GObject * gobject)
1.51 {
1.52 GstMythtvSrc *this = GST_MYTHTV_SRC (gobject);
1.53
1.54 - if (this->spawn_livetv) {
1.55 - g_object_unref (this->spawn_livetv);
1.56 - this->spawn_livetv = NULL;
1.57 - }
1.58 -
1.59 - if (this->file) {
1.60 - g_object_unref (this->file);
1.61 - this->file = NULL;
1.62 - }
1.63 -
1.64 - if (this->backend_info) {
1.65 - g_object_unref (this->backend_info);
1.66 - this->backend_info = NULL;
1.67 - }
1.68 -
1.69 - if (this->uri_name) {
1.70 - g_free (this->uri_name);
1.71 - }
1.72 -
1.73 - if (this->user_agent) {
1.74 - g_free (this->user_agent);
1.75 - }
1.76 -
1.77 - if (this->bytes_queue) {
1.78 - g_byte_array_free (this->bytes_queue, TRUE);
1.79 - this->bytes_queue = NULL;
1.80 - }
1.81 + gst_mythtv_src_clear (this);
1.82
1.83 G_OBJECT_CLASS (parent_class)->finalize (gobject);
1.84 }
1.85 @@ -828,16 +838,11 @@
1.86 static gboolean
1.87 gst_mythtv_src_stop (GstBaseSrc * bsrc)
1.88 {
1.89 - GstMythtvSrc *src;
1.90 + GstMythtvSrc *src = GST_MYTHTV_SRC (bsrc);
1.91 +
1.92 + gst_mythtv_src_clear (src);
1.93
1.94 - src = GST_MYTHTV_SRC (bsrc);
1.95 -
1.96 - if (src->uri_name) {
1.97 - g_free (src->uri_name);
1.98 - src->uri_name = NULL;
1.99 - }
1.100 -
1.101 - src->eos = FALSE;
1.102 + /* src->eos = FALSE; */
1.103
1.104 return TRUE;
1.105 }