Re: [PATCH 11/15] core: Use constructors to create GrlMetadataSourceFooSpec
- From: Iago Toral Quiroga <itoral igalia com>
- To: grilo-list gnome org
- Subject: Re: [PATCH 11/15] core: Use constructors to create GrlMetadataSourceFooSpec
- Date: Mon, 09 Aug 2010 11:40:14 +0200
El lun, 19-07-2010 a las 20:34 +0200, Juan A. Suarez Romero escribió:
> Thus, references counter is properly initialized.
> ---
> src/grl-metadata-source.c | 12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/src/grl-metadata-source.c b/src/grl-metadata-source.c
> index e0f28e2..d14e56a 100644
> --- a/src/grl-metadata-source.c
> +++ b/src/grl-metadata-source.c
> @@ -411,11 +411,11 @@ set_metadata_idle (gpointer user_data)
>
> smctlcb = (struct SetMetadataCtlCb *) user_data;
> keymap = (struct SourceKeyMap *) smctlcb->next->data;
> -
> - sms = g_new0 (GrlMetadataSourceSetMetadataSpec, 1);
> - sms->source = keymap->source;
> - sms->keys = keymap->keys;
> - sms->media = smctlcb->media;
> +
> + sms = grl_metadata_source_set_metadata_spec_new ();
> + sms->source = g_object_ref (keymap->source);
> + sms->keys = g_list_copy (keymap->keys);
Are you sure that you have to copy this list here? Is this copy freed
somewhere else? Notice this list is not provided by the user, thus, we
do not have any need to make a copy of it in principle, there is no risk
of it being freed by the client after invoking us.
Iago
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]