Hi On Fri, Dec 30, 2022 at 6:48 PM <dengp...@chinatelecom.cn> wrote: > > From: "dengp...@chinatelecom.cn" <dengp...@chinatelecom.cn> > > Memory free should be done in vdagent_disconnect using > qemu_input_handler_unregister, replace qemu_input_handler_deactivate > with that. > > Signed-off-by: dengp...@chinatelecom.cn <dengp...@chinatelecom.cn> > Signed-off-by: liuy...@chinatelecom.cn <liuy...@chinatelecom.cn> > --- > ui/vdagent.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/ui/vdagent.c b/ui/vdagent.c > index 4bf50f0c4d..645383b4ec 100644 > --- a/ui/vdagent.c > +++ b/ui/vdagent.c > @@ -863,7 +863,7 @@ static void vdagent_disconnect(VDAgentChardev *vd) > vdagent_reset_bufs(vd); > vd->caps = 0; > if (vd->mouse_hs) { > - qemu_input_handler_deactivate(vd->mouse_hs); > + qemu_input_handler_unregister(vd->mouse_hs);
It looks like vdagent_disconnect() was meant to be called when the agent connection is lost, vdagent_chr_set_fe_open(fe_open=false), so it can later be initialized again during vdagent_chr_recv_caps(). Not sure why this isn't done. Imho, you should instead add qemu_input_handler_unregister() call to vdagent_chr_fini() for now -- Marc-André Lureau