[PATCH 27/67] ui/console: free more QemuConsole resources

marcandre.lureau@redhat.com posted 67 patches 2 years, 5 months ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Dr. David Alan Gilbert" <dave@treblig.org>, Peter Maydell <peter.maydell@linaro.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, "Daniel P. Berrangé" <berrange@redhat.com>, Thomas Huth <thuth@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Akihiko Odaki <akihiko.odaki@daynix.com>
[PATCH 27/67] ui/console: free more QemuConsole resources
Posted by marcandre.lureau@redhat.com 2 years, 5 months ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

This code path is probably not executed at this point, since console
aren't being released.

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

diff --git a/ui/console.c b/ui/console.c
index ffa68c3a22..3cd4c74eec 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1337,8 +1337,11 @@ qemu_console_finalize(Object *obj)
 {
     QemuConsole *c = QEMU_CONSOLE(obj);
 
+    /* TODO: check this code path, and unregister from consoles */
+    g_clear_pointer(&c->device, object_unref);
+    g_clear_pointer(&c->surface, qemu_free_displaysurface);
+    g_clear_pointer(&c->gl_unblock_timer, timer_free);
     g_clear_pointer(&c->ui_timer, timer_free);
-    /* TODO: should unregister from consoles and free itself  */
 }
 
 static void
-- 
2.41.0


Re: [PATCH 27/67] ui/console: free more QemuConsole resources
Posted by Daniel P. Berrangé 2 years, 5 months ago
On Wed, Aug 30, 2023 at 01:38:01PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> This code path is probably not executed at this point, since console
> aren't being released.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  ui/console.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|