From c903ce8a27da84d62fb34980a4da78754baada93 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 21 Mar 2004 03:22:55 +0000 Subject: [PATCH] gst/: clean up used memory in this elements correctly on teardown (closes #137279) Original commit message from CVS: reviewed by Benjamin Otte * gst/autoplug/gstspider.c: (gst_spider_dispose): * gst/elements/gstaggregator.c: (gst_aggregator_finalize), (gst_aggregator_class_init), (gst_aggregator_init): * gst/elements/gstfilesrc.c: (gst_filesrc_init), (gst_filesrc_dispose), (gst_filesrc_set_location): * gst/elements/gstidentity.c: (gst_identity_finalize), (gst_identity_class_init), (gst_identity_chain): * gst/elements/gstmultifilesrc.c: (gst_multifilesrc_open_file): * gst/elements/gststatistics.c: (gst_statistics_finalize), (gst_statistics_class_init): * gst/elements/gsttee.c: (gst_tee_finalize), (gst_tee_class_init), (gst_tee_get_property): clean up used memory in this elements correctly on teardown (closes #137279) --- ChangeLog | 19 +++++++++++++++++++ gst/autoplug/gstspider.c | 1 + gst/elements/gstaggregator.c | 18 +++++++++++++++++- gst/elements/gstfilesrc.c | 20 +++++++++++--------- gst/elements/gstidentity.c | 19 ++++++++++++++++--- gst/elements/gstmultifilesrc.c | 9 ++++++--- gst/elements/gststatistics.c | 19 +++++++++++++++++++ gst/elements/gsttee.c | 17 ++++++++++++++++- plugins/elements/gstaggregator.c | 18 +++++++++++++++++- plugins/elements/gstfilesrc.c | 20 +++++++++++--------- plugins/elements/gstidentity.c | 19 ++++++++++++++++--- plugins/elements/gstmultifilesrc.c | 9 ++++++--- plugins/elements/gststatistics.c | 19 +++++++++++++++++++ plugins/elements/gsttee.c | 17 ++++++++++++++++- 14 files changed, 190 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index b5b9f2a..87fa529 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2004-03-21 Tim-Philipp Müller + + reviewed by Benjamin Otte + + * gst/autoplug/gstspider.c: (gst_spider_dispose): + * gst/elements/gstaggregator.c: (gst_aggregator_finalize), + (gst_aggregator_class_init), (gst_aggregator_init): + * gst/elements/gstfilesrc.c: (gst_filesrc_init), + (gst_filesrc_dispose), (gst_filesrc_set_location): + * gst/elements/gstidentity.c: (gst_identity_finalize), + (gst_identity_class_init), (gst_identity_chain): + * gst/elements/gstmultifilesrc.c: (gst_multifilesrc_open_file): + * gst/elements/gststatistics.c: (gst_statistics_finalize), + (gst_statistics_class_init): + * gst/elements/gsttee.c: (gst_tee_finalize), (gst_tee_class_init), + (gst_tee_get_property): + clean up used memory in this elements correctly on teardown (closes + #137279) + 2004-03-20 Colin Walters * gst/registries/gstxmlregistry.c: diff --git a/gst/autoplug/gstspider.c b/gst/autoplug/gstspider.c index 62c290f..dab96bf 100644 --- a/gst/autoplug/gstspider.c +++ b/gst/autoplug/gstspider.c @@ -196,6 +196,7 @@ gst_spider_dispose (GObject * object) spider = GST_SPIDER (object); g_list_free (spider->factories); + spider->factories = NULL; ((GObjectClass *) parent_class)->dispose (object); } diff --git a/gst/elements/gstaggregator.c b/gst/elements/gstaggregator.c index f79b7b5..0ca84e5 100644 --- a/gst/elements/gstaggregator.c +++ b/gst/elements/gstaggregator.c @@ -83,6 +83,7 @@ static GstPad *gst_aggregator_request_new_pad (GstElement * element, GstPadTemplate * temp, const gchar * unused); static void gst_aggregator_update_functions (GstAggregator * aggregator); +static void gst_aggregator_finalize (GObject * object); static void gst_aggregator_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_aggregator_get_property (GObject * object, guint prop_id, @@ -106,6 +107,20 @@ gst_aggregator_base_init (gpointer g_class) gst_static_pad_template_get (&aggregator_src_template)); gst_element_class_set_details (gstelement_class, &gst_aggregator_details); } + +static void +gst_aggregator_finalize (GObject * object) +{ + GstAggregator *aggregator; + + aggregator = GST_AGGREGATOR (object); + + g_list_free (aggregator->sinkpads); + g_free (aggregator->last_message); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + static void gst_aggregator_class_init (GstAggregatorClass * klass) { @@ -115,7 +130,6 @@ gst_aggregator_class_init (GstAggregatorClass * klass) gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NUM_PADS, g_param_spec_int ("num_pads", "Num pads", "The number of source pads", 0, G_MAXINT, 0, G_PARAM_READABLE)); @@ -130,6 +144,7 @@ gst_aggregator_class_init (GstAggregatorClass * klass) g_param_spec_string ("last_message", "Last message", "The current state of the element", NULL, G_PARAM_READABLE)); + gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_aggregator_finalize); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_aggregator_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_aggregator_get_property); @@ -148,6 +163,7 @@ gst_aggregator_init (GstAggregator * aggregator) aggregator->sinkpads = NULL; aggregator->silent = FALSE; aggregator->sched = AGGREGATOR_LOOP; + aggregator->last_message = NULL; gst_aggregator_update_functions (aggregator); } diff --git a/gst/elements/gstfilesrc.c b/gst/elements/gstfilesrc.c index b37f370..a99553f 100644 --- a/gst/elements/gstfilesrc.c +++ b/gst/elements/gstfilesrc.c @@ -233,6 +233,7 @@ gst_filesrc_init (GstFileSrc * src) src->filename = NULL; src->fd = 0; src->filelen = 0; + src->uri = NULL; src->curoffset = 0; src->block_size = DEFAULT_BLOCKSIZE; @@ -251,12 +252,14 @@ gst_filesrc_dispose (GObject * object) src = GST_FILESRC (object); - G_OBJECT_CLASS (parent_class)->dispose (object); + g_free (src->filename); + g_free (src->uri); + + /* dispose may be called multiple times */ + src->filename = NULL; + src->uri = NULL; - if (src->filename) - g_free (src->filename); - if (src->uri) - g_free (src->uri); + G_OBJECT_CLASS (parent_class)->dispose (object); } static gboolean @@ -266,10 +269,9 @@ gst_filesrc_set_location (GstFileSrc * src, const gchar * location) if (GST_STATE (src) != GST_STATE_READY && GST_STATE (src) != GST_STATE_NULL) return FALSE; - if (src->filename) - g_free (src->filename); - if (src->uri) - g_free (src->uri); + g_free (src->filename); + g_free (src->uri); + /* clear the filename if we get a NULL (is that possible?) */ if (location == NULL) { src->filename = NULL; diff --git a/gst/elements/gstidentity.c b/gst/elements/gstidentity.c index 44b98f2..0849361 100644 --- a/gst/elements/gstidentity.c +++ b/gst/elements/gstidentity.c @@ -68,6 +68,7 @@ enum GST_BOILERPLATE_FULL (GstIdentity, gst_identity, GstElement, GST_TYPE_ELEMENT, _do_init); +static void gst_identity_finalize (GObject * object); static void gst_identity_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_identity_get_property (GObject * object, guint prop_id, @@ -84,6 +85,19 @@ gst_identity_base_init (gpointer g_class) gst_element_class_set_details (gstelement_class, &gst_identity_details); } + +static void +gst_identity_finalize (GObject * object) +{ + GstIdentity *identity; + + identity = GST_IDENTITY (object); + + g_free (identity->last_message); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + static void gst_identity_class_init (GstIdentityClass * klass) { @@ -125,6 +139,7 @@ gst_identity_class_init (GstIdentityClass * klass) G_STRUCT_OFFSET (GstIdentityClass, handoff), NULL, NULL, gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, GST_TYPE_BUFFER); + gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_identity_finalize); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_identity_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_identity_get_property); } @@ -180,9 +195,7 @@ gst_identity_chain (GstPad * pad, GstData * _data) if (identity->drop_probability > 0.0) { if ((gfloat) (1.0 * rand () / (RAND_MAX)) < identity->drop_probability) { - if (identity->last_message != NULL) { - g_free (identity->last_message); - } + g_free (identity->last_message); identity->last_message = g_strdup_printf ("dropping ******* (%s:%s)i (%d bytes, %" G_GINT64_FORMAT ")", GST_DEBUG_PAD_NAME (identity->sinkpad), diff --git a/gst/elements/gstmultifilesrc.c b/gst/elements/gstmultifilesrc.c index a406ce0..156771a 100644 --- a/gst/elements/gstmultifilesrc.c +++ b/gst/elements/gstmultifilesrc.c @@ -248,7 +248,7 @@ gst_multifilesrc_open_file (GstMultiFileSrc * src, GstPad * srcpad) return FALSE; } - /* open the file */ + /* open the file. FIXME: do we need to use O_LARGEFILE here? */ src->fd = open ((const char *) src->currentfilename, O_RDONLY); if (src->fd < 0) { GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, @@ -260,9 +260,12 @@ gst_multifilesrc_open_file (GstMultiFileSrc * src, GstPad * srcpad) /* find the file length */ src->size = lseek (src->fd, 0, SEEK_END); lseek (src->fd, 0, SEEK_SET); - /* map the file into memory */ + /* map the file into memory. + * FIXME: don't map the whole file at once, there might + * be restrictions set. Get max size via getrlimit + * or re-try with smaller size if mmap fails with ENOMEM? */ src->map = mmap (NULL, src->size, PROT_READ, MAP_SHARED, src->fd, 0); - madvise (src->map, src->size, 2); + madvise (src->map, src->size, MADV_SEQUENTIAL); /* collapse state if that failed */ if (src->map == NULL) { close (src->fd); diff --git a/gst/elements/gststatistics.c b/gst/elements/gststatistics.c index e5c5900..a8f2239 100644 --- a/gst/elements/gststatistics.c +++ b/gst/elements/gststatistics.c @@ -64,6 +64,7 @@ enum GST_BOILERPLATE_FULL (GstStatistics, gst_statistics, GstElement, GST_TYPE_ELEMENT, _do_init); +static void gst_statistics_finalize (GObject * object); static void gst_statistics_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_statistics_get_property (GObject * object, guint prop_id, @@ -85,6 +86,23 @@ gst_statistics_base_init (gpointer g_class) gst_element_class_set_details (gstelement_class, &gst_statistics_details); } + +static void +gst_statistics_finalize (GObject * object) +{ + GstStatistics *statistics; + + statistics = GST_STATISTICS (object); + + if (statistics->timer) + g_timer_destroy (statistics->timer); + + if (statistics->last_timer) + g_timer_destroy (statistics->last_timer); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + static void gst_statistics_class_init (GstStatisticsClass * klass) { @@ -129,6 +147,7 @@ gst_statistics_class_init (GstStatisticsClass * klass) G_STRUCT_OFFSET (GstStatisticsClass, update), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_statistics_finalize); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_statistics_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_statistics_get_property); } diff --git a/gst/elements/gsttee.c b/gst/elements/gsttee.c index be45ad7..9dca03d 100644 --- a/gst/elements/gsttee.c +++ b/gst/elements/gsttee.c @@ -66,6 +66,7 @@ GST_BOILERPLATE_FULL (GstTee, gst_tee, GstElement, GST_TYPE_ELEMENT, _do_init); static GstPad *gst_tee_request_new_pad (GstElement * element, GstPadTemplate * temp, const gchar * unused); +static void gst_tee_finalize (GObject * object); static void gst_tee_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_tee_get_property (GObject * object, guint prop_id, @@ -83,6 +84,19 @@ gst_tee_base_init (gpointer g_class) gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&tee_src_template)); } + +static void +gst_tee_finalize (GObject * object) +{ + GstTee *tee; + + tee = GST_TEE (object); + + g_free (tee->last_message); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + static void gst_tee_class_init (GstTeeClass * klass) { @@ -104,6 +118,7 @@ gst_tee_class_init (GstTeeClass * klass) NULL, G_PARAM_READABLE)); + gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_tee_finalize); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_tee_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_tee_get_property); @@ -233,7 +248,7 @@ gst_tee_get_property (GObject * object, guint prop_id, GValue * value, g_value_set_boolean (value, tee->silent); break; case ARG_LAST_MESSAGE: - g_value_set_string ((GValue *) value, tee->last_message); + g_value_set_string (value, tee->last_message); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); diff --git a/plugins/elements/gstaggregator.c b/plugins/elements/gstaggregator.c index f79b7b5..0ca84e5 100644 --- a/plugins/elements/gstaggregator.c +++ b/plugins/elements/gstaggregator.c @@ -83,6 +83,7 @@ static GstPad *gst_aggregator_request_new_pad (GstElement * element, GstPadTemplate * temp, const gchar * unused); static void gst_aggregator_update_functions (GstAggregator * aggregator); +static void gst_aggregator_finalize (GObject * object); static void gst_aggregator_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_aggregator_get_property (GObject * object, guint prop_id, @@ -106,6 +107,20 @@ gst_aggregator_base_init (gpointer g_class) gst_static_pad_template_get (&aggregator_src_template)); gst_element_class_set_details (gstelement_class, &gst_aggregator_details); } + +static void +gst_aggregator_finalize (GObject * object) +{ + GstAggregator *aggregator; + + aggregator = GST_AGGREGATOR (object); + + g_list_free (aggregator->sinkpads); + g_free (aggregator->last_message); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + static void gst_aggregator_class_init (GstAggregatorClass * klass) { @@ -115,7 +130,6 @@ gst_aggregator_class_init (GstAggregatorClass * klass) gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NUM_PADS, g_param_spec_int ("num_pads", "Num pads", "The number of source pads", 0, G_MAXINT, 0, G_PARAM_READABLE)); @@ -130,6 +144,7 @@ gst_aggregator_class_init (GstAggregatorClass * klass) g_param_spec_string ("last_message", "Last message", "The current state of the element", NULL, G_PARAM_READABLE)); + gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_aggregator_finalize); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_aggregator_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_aggregator_get_property); @@ -148,6 +163,7 @@ gst_aggregator_init (GstAggregator * aggregator) aggregator->sinkpads = NULL; aggregator->silent = FALSE; aggregator->sched = AGGREGATOR_LOOP; + aggregator->last_message = NULL; gst_aggregator_update_functions (aggregator); } diff --git a/plugins/elements/gstfilesrc.c b/plugins/elements/gstfilesrc.c index b37f370..a99553f 100644 --- a/plugins/elements/gstfilesrc.c +++ b/plugins/elements/gstfilesrc.c @@ -233,6 +233,7 @@ gst_filesrc_init (GstFileSrc * src) src->filename = NULL; src->fd = 0; src->filelen = 0; + src->uri = NULL; src->curoffset = 0; src->block_size = DEFAULT_BLOCKSIZE; @@ -251,12 +252,14 @@ gst_filesrc_dispose (GObject * object) src = GST_FILESRC (object); - G_OBJECT_CLASS (parent_class)->dispose (object); + g_free (src->filename); + g_free (src->uri); + + /* dispose may be called multiple times */ + src->filename = NULL; + src->uri = NULL; - if (src->filename) - g_free (src->filename); - if (src->uri) - g_free (src->uri); + G_OBJECT_CLASS (parent_class)->dispose (object); } static gboolean @@ -266,10 +269,9 @@ gst_filesrc_set_location (GstFileSrc * src, const gchar * location) if (GST_STATE (src) != GST_STATE_READY && GST_STATE (src) != GST_STATE_NULL) return FALSE; - if (src->filename) - g_free (src->filename); - if (src->uri) - g_free (src->uri); + g_free (src->filename); + g_free (src->uri); + /* clear the filename if we get a NULL (is that possible?) */ if (location == NULL) { src->filename = NULL; diff --git a/plugins/elements/gstidentity.c b/plugins/elements/gstidentity.c index 44b98f2..0849361 100644 --- a/plugins/elements/gstidentity.c +++ b/plugins/elements/gstidentity.c @@ -68,6 +68,7 @@ enum GST_BOILERPLATE_FULL (GstIdentity, gst_identity, GstElement, GST_TYPE_ELEMENT, _do_init); +static void gst_identity_finalize (GObject * object); static void gst_identity_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_identity_get_property (GObject * object, guint prop_id, @@ -84,6 +85,19 @@ gst_identity_base_init (gpointer g_class) gst_element_class_set_details (gstelement_class, &gst_identity_details); } + +static void +gst_identity_finalize (GObject * object) +{ + GstIdentity *identity; + + identity = GST_IDENTITY (object); + + g_free (identity->last_message); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + static void gst_identity_class_init (GstIdentityClass * klass) { @@ -125,6 +139,7 @@ gst_identity_class_init (GstIdentityClass * klass) G_STRUCT_OFFSET (GstIdentityClass, handoff), NULL, NULL, gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, GST_TYPE_BUFFER); + gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_identity_finalize); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_identity_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_identity_get_property); } @@ -180,9 +195,7 @@ gst_identity_chain (GstPad * pad, GstData * _data) if (identity->drop_probability > 0.0) { if ((gfloat) (1.0 * rand () / (RAND_MAX)) < identity->drop_probability) { - if (identity->last_message != NULL) { - g_free (identity->last_message); - } + g_free (identity->last_message); identity->last_message = g_strdup_printf ("dropping ******* (%s:%s)i (%d bytes, %" G_GINT64_FORMAT ")", GST_DEBUG_PAD_NAME (identity->sinkpad), diff --git a/plugins/elements/gstmultifilesrc.c b/plugins/elements/gstmultifilesrc.c index a406ce0..156771a 100644 --- a/plugins/elements/gstmultifilesrc.c +++ b/plugins/elements/gstmultifilesrc.c @@ -248,7 +248,7 @@ gst_multifilesrc_open_file (GstMultiFileSrc * src, GstPad * srcpad) return FALSE; } - /* open the file */ + /* open the file. FIXME: do we need to use O_LARGEFILE here? */ src->fd = open ((const char *) src->currentfilename, O_RDONLY); if (src->fd < 0) { GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, @@ -260,9 +260,12 @@ gst_multifilesrc_open_file (GstMultiFileSrc * src, GstPad * srcpad) /* find the file length */ src->size = lseek (src->fd, 0, SEEK_END); lseek (src->fd, 0, SEEK_SET); - /* map the file into memory */ + /* map the file into memory. + * FIXME: don't map the whole file at once, there might + * be restrictions set. Get max size via getrlimit + * or re-try with smaller size if mmap fails with ENOMEM? */ src->map = mmap (NULL, src->size, PROT_READ, MAP_SHARED, src->fd, 0); - madvise (src->map, src->size, 2); + madvise (src->map, src->size, MADV_SEQUENTIAL); /* collapse state if that failed */ if (src->map == NULL) { close (src->fd); diff --git a/plugins/elements/gststatistics.c b/plugins/elements/gststatistics.c index e5c5900..a8f2239 100644 --- a/plugins/elements/gststatistics.c +++ b/plugins/elements/gststatistics.c @@ -64,6 +64,7 @@ enum GST_BOILERPLATE_FULL (GstStatistics, gst_statistics, GstElement, GST_TYPE_ELEMENT, _do_init); +static void gst_statistics_finalize (GObject * object); static void gst_statistics_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_statistics_get_property (GObject * object, guint prop_id, @@ -85,6 +86,23 @@ gst_statistics_base_init (gpointer g_class) gst_element_class_set_details (gstelement_class, &gst_statistics_details); } + +static void +gst_statistics_finalize (GObject * object) +{ + GstStatistics *statistics; + + statistics = GST_STATISTICS (object); + + if (statistics->timer) + g_timer_destroy (statistics->timer); + + if (statistics->last_timer) + g_timer_destroy (statistics->last_timer); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + static void gst_statistics_class_init (GstStatisticsClass * klass) { @@ -129,6 +147,7 @@ gst_statistics_class_init (GstStatisticsClass * klass) G_STRUCT_OFFSET (GstStatisticsClass, update), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_statistics_finalize); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_statistics_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_statistics_get_property); } diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c index be45ad7..9dca03d 100644 --- a/plugins/elements/gsttee.c +++ b/plugins/elements/gsttee.c @@ -66,6 +66,7 @@ GST_BOILERPLATE_FULL (GstTee, gst_tee, GstElement, GST_TYPE_ELEMENT, _do_init); static GstPad *gst_tee_request_new_pad (GstElement * element, GstPadTemplate * temp, const gchar * unused); +static void gst_tee_finalize (GObject * object); static void gst_tee_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_tee_get_property (GObject * object, guint prop_id, @@ -83,6 +84,19 @@ gst_tee_base_init (gpointer g_class) gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&tee_src_template)); } + +static void +gst_tee_finalize (GObject * object) +{ + GstTee *tee; + + tee = GST_TEE (object); + + g_free (tee->last_message); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + static void gst_tee_class_init (GstTeeClass * klass) { @@ -104,6 +118,7 @@ gst_tee_class_init (GstTeeClass * klass) NULL, G_PARAM_READABLE)); + gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_tee_finalize); gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_tee_set_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_tee_get_property); @@ -233,7 +248,7 @@ gst_tee_get_property (GObject * object, guint prop_id, GValue * value, g_value_set_boolean (value, tee->silent); break; case ARG_LAST_MESSAGE: - g_value_set_string ((GValue *) value, tee->last_message); + g_value_set_string (value, tee->last_message); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -- 2.7.4