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

Marc-André Lureau marcandre.lureau at gmail.com
Thu Mar 24 10:59:10 UTC 2016


On Thu, Mar 24, 2016 at 12:39 AM, Marc-André Lureau <mlureau at redhat.com> 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).

thanks


-- 
Marc-André Lureau


More information about the Spice-devel mailing list