From 878490937c6273f27191e3a195c7a60fa68819b8 Mon Sep 17 00:00:00 2001 From: Guoyi Tu Date: Thu, 17 Aug 2023 22:12:53 +0800 Subject: [PATCH] ui/vdagent: Unregister input handler of mouse during finalization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Input handler resource should be released when VDAgentChardev object finalize Signed-off-by: Guoyi Tu Signed-off-by: dengpengcheng Reviewed-by: Marc-André Lureau Message-Id: --- ui/vdagent.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/vdagent.c b/ui/vdagent.c index 4b9a1fb7c5..00d36a8677 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -926,6 +926,9 @@ static void vdagent_chr_fini(Object *obj) migrate_del_blocker(vd->migration_blocker); vdagent_disconnect(vd); + if (vd->mouse_hs) { + qemu_input_handler_unregister(vd->mouse_hs); + } buffer_free(&vd->outbuf); error_free(vd->migration_blocker); }