Merge branch 'mesa_7_6_branch'
[mesa.git] / src / gallium / state_trackers / xorg / xorg_driver.c
index 3dff8d859ee18cbc5cf40ae281ecebc8b894b12d..4bc87aa613d083ab3bc454666fc627a3cb26544f 100644 (file)
@@ -558,7 +558,7 @@ ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
     xf86SetBlackWhitePixels(pScreen);
 
     ms->exa = xorg_exa_init(pScrn);
-    ms->debug_fallback = debug_get_option_bool("XORG_DEBUG_FALLBACK", TRUE);
+    ms->debug_fallback = debug_get_bool_option("XORG_DEBUG_FALLBACK", TRUE);
 
     miInitializeBackingStore(pScreen);
     xf86SetBackingStore(pScreen);
@@ -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;