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

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

 



Hi,

On Mon, May 18, 2015 at 01:27:14PM +0200, Marc-André Lureau wrote:
> Hi
>
> On Mon, May 18, 2015 at 9:09 AM, Victor Toso <victortoso@xxxxxxxxxx> wrote:
>
> > PipeInputStream and PipeOutputStream should not fail when creating
> > GPollableStream source. It is already checked and unref in case of
> > existing source.
> >
>
> The check is about making sure that either the source is NULL or it is
> destroyed.
>
> As such it looks fine to me, or it might leak since the condition to unref
> might not be reached.
>
> Do you have a test case for the issue you encoutered?

Yes, with the following change of g_output_stream_write_all_async it
breaks the copy due this check.

I'm looking for leaks as well, trying to copy several files our just big
files.. not 100% sure if this is leak free.

>
> ---
> >  gtk/giopipe.c | 6 ------
> >  1 file changed, 6 deletions(-)
> >
> > diff --git a/gtk/giopipe.c b/gtk/giopipe.c
> > index 440cae9..32fa4fa 100644
> > --- a/gtk/giopipe.c
> > +++ b/gtk/giopipe.c
> > @@ -234,9 +234,6 @@ pipe_input_stream_create_source (GPollableInputStream
> > *stream,
> >      PipeInputStream *self = PIPE_INPUT_STREAM(stream);
> >      GSource *pollable_source;
> >
> > -    g_return_val_if_fail (self->source == NULL ||
> > -                          g_source_is_destroyed (self->source), NULL);
> > -
> >      if (self->source && g_source_is_destroyed (self->source))
> >          g_source_unref (self->source);
> >
> > @@ -416,9 +413,6 @@ pipe_output_stream_create_source
> > (GPollableOutputStream *stream,
> >      PipeOutputStream *self = PIPE_OUTPUT_STREAM(stream);
> >      GSource *pollable_source;
> >
> > -    g_return_val_if_fail (self->source == NULL ||
> > -                          g_source_is_destroyed (self->source), NULL);
> > -
> >      if (self->source && g_source_is_destroyed (self->source))
> >          g_source_unref (self->source);
> >
> > --
> > 2.4.1
> >
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel
> >
> 
> 
> 
> -- 
> Marc-André Lureau
_______________________________________________
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]