[Spice-devel] [PATCH spice-server 2/6] Call parent constructor always at the beginning

Christophe Fergeau cfergeau at redhat.com
Fri Oct 28 13:43:33 UTC 2016


On Fri, Oct 28, 2016 at 11:59:52AM +0100, Frediano Ziglio wrote:
> Base object should be constructed first.

This sounds a bit too affirmative, glib/gio usually chains up to the
parents 'constructed' at the end of the vfunc. This sentence probably
can be dropped.

> In this case there is not much change but better
> to follow that style as all other constructors
> do.

And this part is good enough for me, the rest of spice-server code base
is indeed doing this, so we can be consistent


Acked-by: Christophe Fergeau <cfergeau at redhat.com>

> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/red-channel.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/server/red-channel.c b/server/red-channel.c
> index 3b14fbf..8f9ae6c 100644
> --- a/server/red-channel.c
> +++ b/server/red-channel.c
> @@ -226,6 +226,8 @@ red_channel_constructed(GObject *object)
>  
>      RedChannelClass *klass = RED_CHANNEL_GET_CLASS(self);
>  
> +    G_OBJECT_CLASS(red_channel_parent_class)->constructed(object);
> +
>      spice_assert(klass->config_socket && klass->on_disconnect &&
>                   klass->alloc_recv_buf && klass->release_recv_buf);
>      spice_assert(klass->handle_migrate_data ||
> @@ -238,8 +240,6 @@ red_channel_constructed(GObject *object)
>      self->priv->incoming_cb.handle_message = (handle_message_proc)klass->handle_message;
>      self->priv->incoming_cb.handle_parsed = (handle_parsed_proc)klass->handle_parsed;
>      self->priv->incoming_cb.parser = klass->parser;
> -
> -    G_OBJECT_CLASS(red_channel_parent_class)->constructed(object);
>  }
>  
>  static void red_channel_client_default_connect(RedChannel *channel, RedClient *client,
> -- 
> 2.7.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20161028/312a6caf/attachment.sig>


More information about the Spice-devel mailing list