[Spice-devel] [PATCH spice-gtk v2 4/8] display: return NULL in spice_display_get_gl_scanout()

Pavel Grunt pgrunt at redhat.com
Thu Mar 24 11:03:56 UTC 2016


On Thu, 2016-03-24 at 11:59 +0100, Marc-André Lureau wrote:
> On Thu, Mar 24, 2016 at 12:39 AM, Marc-André Lureau <mlureau at redhat.c
> om> wrote:
> > 
> > > 
> > > When / how it can happen ? Looking at gl_scanout() there is
> > > g_return if
> > > scanout == NULL, if NULL is a valid/expected return value then
> > > that
> > > g_return should be changed.
> > Good point. AI think I wrote this initially thinking that no one
> > should ever call get_gl_scanout() without having first received the
> > scanout notification, but that assumption is wrong. It should be
> > fine to call get_gl_scanout() and it's easier to deal with a NULL
> > return value rather than checking the returned scanout.fd ==
> > -1.  I'll change the assert. (btw, the set_static_boxed for the
> > property should be fine)
> 
> Actually, gl_scanout() should only be called with a valid scanout,
> the
> patch doesn't need to be modified then. If you prefer, we can add a
> comment above the g_return_if_fail(scanout).
> 
Yes please

Pavel



More information about the Spice-devel mailing list