From f1b8b79fd9c95f546431a1b2654fd5cbf372cf20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 23 Jun 2026 11:44:27 +0400 Subject: [PATCH] ui/console: init gl_unblock_timer in qemu_console_init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move gl_unblock_timer allocation from graphic_console_init() to qemu_console_init(), similar to what was done in commit cfde05d15b ("ui/console: allocate ui_timer in QemuConsole"). This fixes leaking timers on console recycling. Fixes: a9b1e471e17 ("ui: add a gl-unblock warning timer") Reviewed-by: Daniel P. Berrangé Reviewed-by: Akihiko Odaki Signed-off-by: Marc-André Lureau Message-ID: <20260623-b4-ui-v4-12-4656aec3398d@redhat.com> --- ui/console.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/console.c b/ui/console.c index 436444723a..58f29e82c8 100644 --- a/ui/console.c +++ b/ui/console.c @@ -433,6 +433,8 @@ qemu_console_init(Object *obj) c->window_id = -1; c->ui_timer = timer_new_ms(QEMU_CLOCK_REALTIME, dpy_set_ui_info_timer, c); + c->gl_unblock_timer = timer_new_ms(QEMU_CLOCK_REALTIME, + console_hw_gl_unblock_timer, c); qemu_console_register(c); } @@ -1116,8 +1118,6 @@ QemuConsole *qemu_graphic_console_create(DeviceState *dev, uint32_t head, surface = qemu_create_placeholder_surface(width, height, noinit); qemu_console_set_surface(s, surface); - s->gl_unblock_timer = timer_new_ms(QEMU_CLOCK_REALTIME, - console_hw_gl_unblock_timer, s); return s; }