[Spice-devel] [PATCH spice-server 11/12] Move monitors_config_ref inside red_monitors_config_item_new

Frediano Ziglio fziglio at redhat.com
Tue Oct 18 09:09:56 UTC 2016


Make move symmetric red_monitors_config_item_new and
red_monitors_config_item_free.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/dcc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/dcc.c b/server/dcc.c
index 9bd1c0a..82a9f49 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -657,7 +657,7 @@ static RedMonitorsConfigItem *red_monitors_config_item_new(RedChannel* channel,
     RedMonitorsConfigItem *mci;
 
     mci = spice_new(RedMonitorsConfigItem, 1);
-    mci->monitors_config = monitors_config;
+    mci->monitors_config = monitors_config_ref(monitors_config);
 
     red_pipe_item_init_full(&mci->pipe_item, RED_PIPE_ITEM_TYPE_MONITORS_CONFIG,
                             red_monitors_config_item_free);
@@ -681,7 +681,7 @@ void dcc_push_monitors_config(DisplayChannelClient *dcc)
     }
 
     mci = red_monitors_config_item_new(red_channel_client_get_channel(RED_CHANNEL_CLIENT(dcc)),
-                                       monitors_config_ref(dc->priv->monitors_config));
+                                       monitors_config);
     red_channel_client_pipe_add(RED_CHANNEL_CLIENT(dcc), &mci->pipe_item);
     red_channel_client_push(RED_CHANNEL_CLIENT(dcc));
 }
-- 
2.7.4



More information about the Spice-devel mailing list