Re: [spice-gtk PATCH v4 1/6] giopipe: don't fail on create_source

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

 



On Tue, Jun 02, 2015 at 12:32:40PM -0400, Marc-André Lureau wrote:
> ----- Original Message -----
> > Hey, thanks for the quick review!
> > 
> > > >  static void
> > > > +set_all_sources_ready (GList *sources)
> > > > +{
> > > > +    GList *it;
> > > > +    for (it = sources; it != NULL; it = it->next) {
> > > > +        GSource *s = it->data;
> > > > +        if (s != NULL && !g_source_is_destroyed(s))
> > > > +            g_source_set_ready_time(s, 0);
> > > > +    }
> > > > +    g_list_free_full (sources, (GDestroyNotify) g_source_unref);
> > > > +}
> > > > +
> > > > +static void
> > > >  pipe_input_stream_check_source (PipeInputStream *self)
> > > >  {
> > > >      if (self->source && !g_source_is_destroyed(self->source) &&
> > > > -
> > > > g_pollable_input_stream_is_readable(G_POLLABLE_INPUT_STREAM(self)))
> > > > -        g_source_set_ready_time(self->source, 0);
> > > > +
> > > > g_pollable_input_stream_is_readable(G_POLLABLE_INPUT_STREAM(self))) {
> > > > +        set_all_sources_ready(self->created_sources);
> > > > +        self->created_sources = NULL;
> > > > +        self->source = NULL;
> > > >
> > >
> > > Why do you free the sources? Only the destroyed one should be enough. The
> > > rest should still remain "dispatchable"
> >
> > I unref all GSources because all of them should be destroyed or dispatched
> > by g_source_set_ready_time in the set_all_sources_ready function above;
>
> But if they are not yet destroyed, they should still be dispatched.

set_all_sources_ready() dispatch all GSources that are no yet destroyed.
Do you mean that we should keep the reference until the source is
destroyed?
_______________________________________________
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]