> > Encapsulate the structure a bit more and avoid poking into it from other > class implementations. Getting ready to split RedChannelClient out to a > separate file. > --- > server/red-channel.c | 12 +++++++++++- > server/red-channel.h | 2 ++ > server/spicevmc.c | 2 +- > 3 files changed, 14 insertions(+), 2 deletions(-) > > diff --git a/server/red-channel.c b/server/red-channel.c > index 615c2a3..870296c 100644 > --- a/server/red-channel.c > +++ b/server/red-channel.c > @@ -2111,7 +2111,7 @@ void red_client_destroy(RedClient *client) > // is not synchronous. > rcc = link->data; > channel = red_channel_client_get_channel(rcc); > - rcc->destroying = 1; > + red_channel_client_set_destroying(rcc); > // some channels may be in other threads. However we currently > // assume disconnect is synchronous (we changed the dispatcher > // to wait for disconnection) > @@ -2448,3 +2448,13 @@ RedChannel* > red_channel_client_get_channel(RedChannelClient *rcc) > { > return rcc->channel; > } > + > +gboolean red_channel_client_is_destroying(RedChannelClient *rcc) > +{ > + return rcc->destroying; > +} > + > +void red_channel_client_set_destroying(RedChannelClient *rcc) > +{ > + rcc->destroying = TRUE; > +} > diff --git a/server/red-channel.h b/server/red-channel.h > index 039ac09..e528d08 100644 > --- a/server/red-channel.h > +++ b/server/red-channel.h > @@ -629,5 +629,7 @@ int red_channel_wait_all_sent(RedChannel *channel, > int64_t timeout); > void red_channel_client_disconnect_if_pending_send(RedChannelClient *rcc); > RedChannel* red_channel_client_get_channel(RedChannelClient *rcc); > +gboolean red_channel_client_is_destroying(RedChannelClient *rcc); > +void red_channel_client_set_destroying(RedChannelClient *rcc); > > #endif > diff --git a/server/spicevmc.c b/server/spicevmc.c > index 5e310a6..4e9dd0d 100644 > --- a/server/spicevmc.c > +++ b/server/spicevmc.c > @@ -306,7 +306,7 @@ static void > spicevmc_red_channel_client_on_disconnect(RedChannelClient *rcc) > > /* Don't destroy the rcc if it is already being destroyed, as then > red_client_destroy/red_channel_client_destroy will already do this! > */ > - if (!rcc->destroying) > + if (!red_channel_client_is_destroying(rcc)) > red_channel_client_destroy(rcc); > > state->rcc = NULL; Acked-by: Frediano Ziglio <fziglio@xxxxxxxxxx> Frediano _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel