]> git.proxmox.com Git - qemu.git/blobdiff - qemu-char.c
libqos: add fw_cfg support
[qemu.git] / qemu-char.c
index 14707eac6881ae98b1b194991d833cffeb6a7dc6..728ed9b4778aaf9c57219399bc169551fa3985da 100644 (file)
@@ -663,6 +663,7 @@ static guint io_add_watch_poll(GIOChannel *channel,
                                gpointer user_data)
 {
     IOWatchPoll *iwp;
+    int tag;
 
     iwp = (IOWatchPoll *) g_source_new(&io_watch_poll_funcs, sizeof(IOWatchPoll));
     iwp->fd_can_read = fd_can_read;
@@ -671,7 +672,9 @@ static guint io_add_watch_poll(GIOChannel *channel,
     iwp->fd_read = (GSourceFunc) fd_read;
     iwp->src = NULL;
 
-    return g_source_attach(&iwp->parent, NULL);
+    tag = g_source_attach(&iwp->parent, NULL);
+    g_source_unref(&iwp->parent);
+    return tag;
 }
 
 #ifndef _WIN32