xlib: fix skipping visuals in destroy_visuals_on_display

This commit decrements the loop index after deletion to ensure
all visuals for the display are properly destroyed.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14947
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40422>
This commit is contained in:
Mixie 2026-03-14 21:32:06 +03:00 committed by Marge Bot
parent 61d1e8fc85
commit 59ef73d71f

View file

@ -606,6 +606,7 @@ destroy_visuals_on_display(Display *dpy)
for (j = i; j < NumVisuals - 1; j++)
VisualTable[j] = VisualTable[j + 1];
NumVisuals--;
i--;
}
}
}