Re: [PATCH spice-gtk 13/15] session: remove sticky disconnecting flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 26, 2014 at 04:17:24PM +0100, Christophe Fergeau wrote:
> On Tue, Nov 25, 2014 at 02:19:26PM +0100, Marc-André Lureau wrote:
> > This used to help prevent double-unref when channel were considered part
> > of the session as long as they lived. Now it shouldn't be required
> > anymore
> 
> This is a bit confusing as a commit message, as after this commit the
> 'disconnecting' flag is still there, it's only used in less places.
> So "it shouldn't be required anymore" but we still keep it ?

Ah, actually this makes sense in combination with patch 15/15 which
reuse this slightly differently.

Christophe

> 
> > ---
> >  gtk/spice-session.c | 9 +++------
> >  1 file changed, 3 insertions(+), 6 deletions(-)
> > 
> > diff --git a/gtk/spice-session.c b/gtk/spice-session.c
> > index b9a0ee9..f0347db 100644
> > --- a/gtk/spice-session.c
> > +++ b/gtk/spice-session.c
> > @@ -1380,12 +1380,11 @@ gboolean spice_session_connect(SpiceSession *session)
> >      SpiceSessionPrivate *s;
> >  
> >      g_return_val_if_fail(SPICE_IS_SESSION(session), FALSE);
> > -    g_return_val_if_fail(session->priv != NULL, FALSE);
> 
> This bit is unrelated.
> 
> >  
> >      s = session->priv;
> > +    g_return_val_if_fail(!s->disconnecting, FALSE);
> >  
> >      spice_session_disconnect(session);
> > -    s->disconnecting = FALSE;
> >  
> >      s->client_provided_sockets = FALSE;
> >  
> > @@ -1415,13 +1414,12 @@ gboolean spice_session_open_fd(SpiceSession *session, int fd)
> >      SpiceSessionPrivate *s;
> >  
> >      g_return_val_if_fail(SPICE_IS_SESSION(session), FALSE);
> > -    g_return_val_if_fail(session->priv != NULL, FALSE);
> >      g_return_val_if_fail(fd >= -1, FALSE);
> >  
> >      s = session->priv;
> > +    g_return_val_if_fail(!s->disconnecting, FALSE);
> >  
> >      spice_session_disconnect(session);
> > -    s->disconnecting = FALSE;
> >  
> >      s->client_provided_sockets = TRUE;
> >  
> > @@ -1758,8 +1756,7 @@ void spice_session_disconnect(SpiceSession *session)
> >      memset(s->uuid, 0, sizeof(s->uuid));
> >  
> >      spice_session_abort_migration(session);
> > -    /* we leave disconnecting = TRUE, so that spice_channel_disconnect()
> > -       is not called multiple times */
> > +    s->disconnecting = FALSE;
> >  }
> >  
> >  /**
> > -- 
> > 2.1.0
> > 
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel



> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/spice-devel

Attachment: pgpDaYuCe2vEl.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]