mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:10 +00:00
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 commitcfde05d15b("ui/console: allocate ui_timer in QemuConsole"). This fixes leaking timers on console recycling. Fixes:a9b1e471e1("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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user