xlib: use XMesaDestroyVisual when destroying display visuals

destroy_visuals_on_display() frees XMesaVisual objects directly, but
XMesaVisual has a dedicated destructor.

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:28:42 +03:00 committed by Marge Bot
parent 447a1d2e8d
commit 8131af3f77

View file

@ -602,7 +602,7 @@ destroy_visuals_on_display(Display *dpy)
if (VisualTable[i]->display == dpy) {
/* remove this visual */
int j;
free(VisualTable[i]);
XMesaDestroyVisual(VisualTable[i]);
for (j = i; j < NumVisuals - 1; j++)
VisualTable[j] = VisualTable[j + 1];
NumVisuals--;