[Spice-commits] server/dcc.c
Frediano Ziglio
fziglio at kemper.freedesktop.org
Tue Jun 7 22:12:04 UTC 2016
server/dcc.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
New commits:
commit a051a4d884ddc88ba81873e461920b5c9e0e87f1
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Tue Jun 7 08:24:08 2016 +0100
Move dcc glz field initialization into dcc_new
There is no reason to initialize these fields in two different places.
Note that an usage between dcc_new and the function where these
field were initialised would have resulted in a crash.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/server/dcc.c b/server/dcc.c
index 336bae0..a88f8e6 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -392,6 +392,10 @@ DisplayChannelClient *dcc_new(DisplayChannel *display,
dcc_init_stream_agents(dcc);
+ ring_init(&dcc->glz_drawables);
+ ring_init(&dcc->glz_drawables_inst_to_free);
+ pthread_mutex_init(&dcc->glz_drawables_inst_to_free_lock, NULL);
+
dcc_encoders_init(dcc);
return dcc;
@@ -1371,9 +1375,6 @@ static int dcc_handle_init(DisplayChannelClient *dcc, SpiceMsgcDisplayInit *init
spice_return_val_if_fail(dcc->pixmap_cache, FALSE);
spice_return_val_if_fail(!dcc->glz_dict, FALSE);
- ring_init(&dcc->glz_drawables);
- ring_init(&dcc->glz_drawables_inst_to_free);
- pthread_mutex_init(&dcc->glz_drawables_inst_to_free_lock, NULL);
dcc->glz_dict = dcc_get_glz_dictionary(dcc,
init->glz_dictionary_id,
init->glz_dictionary_window_size);
@@ -1479,9 +1480,6 @@ static int dcc_handle_migrate_glz_dictionary(DisplayChannelClient *dcc,
{
spice_return_val_if_fail(!dcc->glz_dict, FALSE);
- ring_init(&dcc->glz_drawables);
- ring_init(&dcc->glz_drawables_inst_to_free);
- pthread_mutex_init(&dcc->glz_drawables_inst_to_free_lock, NULL);
dcc->glz_dict = dcc_restore_glz_dictionary(dcc,
migrate->glz_dict_id,
&migrate->glz_dict_data);
More information about the Spice-commits
mailing list