wayland-drm: close fd after the display is uninitialized

This fixes a "kernel rejected pushbuf: Bad file descriptor" error on
wl_drm display destruction.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
This commit is contained in:
Philipp Brüschweiler 2012-08-15 18:14:44 +02:00 committed by Kristian Høgsberg
parent 50dec63790
commit 0efd564a09

View file

@ -71,8 +71,6 @@ wayland_drm_display_destroy(struct native_display *ndpy)
{
struct wayland_drm_display *drmdpy = wayland_drm_display(ndpy);
if (drmdpy->fd)
close(drmdpy->fd);
if (drmdpy->wl_drm)
wl_drm_destroy(drmdpy->wl_drm);
if (drmdpy->device_name)
@ -84,6 +82,9 @@ wayland_drm_display_destroy(struct native_display *ndpy)
ndpy_uninit(ndpy);
if (drmdpy->fd)
close(drmdpy->fd);
FREE(drmdpy);
}