[Mesa-dev] [PATCH] egl/dri2: only destroy created objects

Tapani Pälli tapani.palli at intel.com
Wed Aug 30 04:16:52 UTC 2017



On 08/30/2017 06:50 AM, Tapani Pälli wrote:
> 
> On 08/29/2017 12:51 PM, Michael Olbrich wrote:
>> dri2_display_destroy may be called by dri2_initialize_wayland_drm() if
>> initialization fails. In this case, these objects may not be initialized.
> 
> Same thing can happen with dri2_initialize_wayland_swrast, would be good 
> to fix both at one go.

and that is actually what the patch does, both call dri2_display_destroy 
the same way :)

Reviewed-by: Tapani Pälli <tapani.palli at intel.com>


>> Signed-off-by: Michael Olbrich <m.olbrich at pengutronix.de>
>> ---
>>   src/egl/drivers/dri2/egl_dri2.c | 9 ++++++---
>>   1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/egl/drivers/dri2/egl_dri2.c 
>> b/src/egl/drivers/dri2/egl_dri2.c
>> index a197e0456fd2..d86c6af225fc 100644
>> --- a/src/egl/drivers/dri2/egl_dri2.c
>> +++ b/src/egl/drivers/dri2/egl_dri2.c
>> @@ -944,9 +944,12 @@ dri2_display_destroy(_EGLDisplay *disp)
>>             zwp_linux_dmabuf_v1_destroy(dri2_dpy->wl_dmabuf);
>>         if (dri2_dpy->wl_shm)
>>             wl_shm_destroy(dri2_dpy->wl_shm);
>> -      wl_registry_destroy(dri2_dpy->wl_registry);
>> -      wl_event_queue_destroy(dri2_dpy->wl_queue);
>> -      wl_proxy_wrapper_destroy(dri2_dpy->wl_dpy_wrapper);
>> +      if (dri2_dpy->wl_registry)
>> +         wl_registry_destroy(dri2_dpy->wl_registry);
>> +      if (dri2_dpy->wl_queue)
>> +         wl_event_queue_destroy(dri2_dpy->wl_queue);
>> +      if (dri2_dpy->wl_dpy_wrapper)
>> +         wl_proxy_wrapper_destroy(dri2_dpy->wl_dpy_wrapper);
>>         u_vector_finish(&dri2_dpy->wl_modifiers.argb8888);
>>         u_vector_finish(&dri2_dpy->wl_modifiers.xrgb8888);
>>         u_vector_finish(&dri2_dpy->wl_modifiers.rgb565);
>>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list