ui/console: init gl_unblock_timer in qemu_console_init
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é <berrange@redhat.com> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20260623-b4-ui-v4-12-4656aec3398d@redhat.com>
Marc-André Lureau committed
Jun 23, 2026 at 11:44 UTC
f1b8b79fd9c95f546431a1b2654fd5cbf372cf20
1 file changed
+2
-2
ui/console.c
+2
-2
@@ -433,6 +433,8 @@ qemu_console_init(Object *obj)
433
c->window_id = -1;
434
c->ui_timer = timer_new_ms(QEMU_CLOCK_REALTIME,
435
dpy_set_ui_info_timer, c);
436
+ c->gl_unblock_timer = timer_new_ms(QEMU_CLOCK_REALTIME,
437
+ console_hw_gl_unblock_timer, c);
438
qemu_console_register(c);
439
}
440
@@ -1116,8 +1118,6 @@ QemuConsole *qemu_graphic_console_create(DeviceState *dev, uint32_t head,
1118
1119
surface = qemu_create_placeholder_surface(width, height, noinit);
1120
qemu_console_set_surface(s, surface);
1119
- s->gl_unblock_timer = timer_new_ms(QEMU_CLOCK_REALTIME,
1120
- console_hw_gl_unblock_timer, s);
1121
return s;
1122
}
1123