summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/virt-viewer-events.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/virt-viewer-events.c b/src/virt-viewer-events.c
index 44740c3..9636e3e 100644
--- a/src/virt-viewer-events.c
+++ b/src/virt-viewer-events.c
@@ -239,6 +239,10 @@ virt_viewer_events_remove_handle(int watch)
data->events = 0;
}
+ g_warn_if_fail(data->channel != NULL);
+ g_io_channel_unref(data->channel);
+ data->channel = NULL;
+
/* since the actual watch deletion is done asynchronously, a update_handle call may
* reschedule the watch before it's fully deleted, that's why we need to mark it as
* 'removed' to prevent reuse