Clear dangling GLib event source tag when virtio-console is
unrealized. This prevents a stale tag from being used, and
maintains consistency with the rest of virtio-console.
Signed-off-by: Matthew Penney <matt@matthewpenney.net>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <
20260305213308.96441-1-matt@matthewpenney.net>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
VirtConsole *vcon = VIRTIO_CONSOLE(dev);
if (vcon->watch) {
- g_source_remove(vcon->watch);
+ g_clear_handle_id(&vcon->watch, g_source_remove);
}
}