hw/char/virtio-console: clear dangling GLib event source tag
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>
Matthew Penney committed
Mar 5, 2026 at 21:33 UTC
34aad589019c8687fb3b19ba79d64d97071a7205
1 file changed
+1
-1
hw/char/virtio-console.c
+1
-1
@@ -257,7 +257,7 @@ static void virtconsole_unrealize(DeviceState *dev)
257
VirtConsole *vcon = VIRTIO_CONSOLE(dev);
258
259
if (vcon->watch) {
260
- g_source_remove(vcon->watch);
260
+ g_clear_handle_id(&vcon->watch, g_source_remove);
261
}
262
}
263