[PATCH 07/12] ui/vdagent: unregister clipboard peer on finalize

marcandre.lureau@redhat.com posted 12 patches 4 years, 6 months ago
There is a newer version of this series
[PATCH 07/12] ui/vdagent: unregister clipboard peer on finalize
Posted by marcandre.lureau@redhat.com 4 years, 6 months ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 ui/vdagent.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ui/vdagent.c b/ui/vdagent.c
index 5ae5734c81..bce9f44b7b 100644
--- a/ui/vdagent.c
+++ b/ui/vdagent.c
@@ -782,6 +782,7 @@ static void vdagent_chr_fini(Object *obj)
     VDAgentChardev *vd = QEMU_VDAGENT_CHARDEV(obj);
 
     buffer_free(&vd->outbuf);
+    qemu_clipboard_peer_unregister(&vd->cbpeer);
 }
 
 static const TypeInfo vdagent_chr_type_info = {
-- 
2.32.0.93.g670b81a890


Re: [PATCH 07/12] ui/vdagent: unregister clipboard peer on finalize
Posted by Marc-André Lureau 4 years, 6 months ago
Hi

On Mon, Jul 19, 2021 at 11:30 AM <marcandre.lureau@redhat.com> wrote:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  ui/vdagent.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/ui/vdagent.c b/ui/vdagent.c
> index 5ae5734c81..bce9f44b7b 100644
> --- a/ui/vdagent.c
> +++ b/ui/vdagent.c
> @@ -782,6 +782,7 @@ static void vdagent_chr_fini(Object *obj)
>      VDAgentChardev *vd = QEMU_VDAGENT_CHARDEV(obj);
>
>      buffer_free(&vd->outbuf);
> +    qemu_clipboard_peer_unregister(&vd->cbpeer);
>

The call needs to be guarded, as notifier_remove() crashes on non-added
notifiers. The mouse handler should also be deactivated. Similarly to
set_fe_open(false). And I realize that outbuf should also be reset in that
case.

 }
>
>  static const TypeInfo vdagent_chr_type_info = {
> --
> 2.32.0.93.g670b81a890
>
>
>

-- 
Marc-André Lureau