st/xorg: Check that ms->api->destroy is not NULL before calling it.

Fixes potential crash on X server shutdown.
This commit is contained in:
Michel Dänzer 2009-10-01 16:45:11 +02:00
parent 0b466c8705
commit e32a341be6
1 changed files with 3 additions and 1 deletions

View File

@ -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;