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

Frediano Ziglio fziglio at redhat.com
Fri Oct 28 10:59:52 UTC 2016


Base object should be constructed first.
In this case there is not much change but better
to follow that style as all other constructors
do.

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



More information about the Spice-devel mailing list