From 7fa05a87602aec511a7f868a5858964daefa02d0 Mon Sep 17 00:00:00 2001 From: Tautvis Date: Tue, 4 Nov 2025 01:45:34 +0200 Subject: [PATCH] modesetting: call xf86_cursors_fini during CloseScreen Add matching call for xf86_cursors_init to clean memory, as during initialization it allocates memory (depends, but is something like ~256Kb) and it leaks when XServer resets. Signed-off-by: Tautvis --- hw/xfree86/drivers/modesetting/driver.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index d509f4400e..adc547ea85 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -2183,6 +2183,10 @@ CloseScreen(ScreenPtr pScreen) ms->drmmode.shadow_fb2 = NULL; } + if (!ms->drmmode.sw_cursor) { + xf86_cursors_fini(pScreen); + } + drmmode_uevent_fini(pScrn, &ms->drmmode); drmmode_free_bos(pScrn, &ms->drmmode);