From e32a341be66391e0ea1cc6ce19bbd57997f46b6b Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 1 Oct 2009 16:45:11 +0200 Subject: st/xorg: Check that ms->api->destroy is not NULL before calling it. Fixes potential crash on X server shutdown. --- src/gallium/state_trackers/xorg/xorg_driver.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index 8c4cba035a1..4bc87aa613d 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -726,8 +726,10 @@ CloseScreen(int scrnIndex, ScreenPtr pScreen) if (ms->exa) xorg_exa_close(pScrn); + if (ms->api->destroy) ms->api->destroy(ms->api); - ms->api = NULL; + ms->api = NULL; + drmClose(ms->fd); ms->fd = -1; -- cgit v1.2.3