st/xorg: On close wait on fences and then destroy the screen

This commit is contained in:
Jakob Bornecrantz
2009-12-30 04:46:12 +01:00
parent 5fdc4f732f
commit d34fdf149d
+11 -1
View File
@@ -255,9 +255,19 @@ static Bool
drv_close_resource_management(ScrnInfoPtr pScrn)
{
modesettingPtr ms = modesettingPTR(pScrn);
int i;
if (ms->screen)
if (ms->screen) {
assert(ms->ctx == NULL);
for (i = 0; i < XORG_NR_FENCES; i++) {
if (ms->fence[i]) {
ms->screen->fence_finish(ms->screen, ms->fence[i], 0);
ms->screen->fence_reference(ms->screen, &ms->fence[i], NULL);
}
}
ms->screen->destroy(ms->screen);
}
ms->screen = NULL;
if (ms->api && ms->api->destroy)