summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2015-07-22 03:27:50 +0200
committerFabiano FidĂȘncio <fidencio@redhat.com>2016-01-05 21:28:43 +0100
commitd8b5f364fad49f619b251199eed3660d18cf87aa (patch)
treece94c3f346d94e320061fdf784fec5e229942140
parent8b7f4e26d6451da65bcc128f01b60b1748c3123a (diff)
events: allow zero timeouts for timer
In libvirt, it's perfectly possible and widely used to have disabled timers (timeout=-1) and fire them up 'randomly' with timeout=0. However, with current mapping into glib mainloop it's not possible and causing troubles. Based on commit a40a1732e0d53fcc44b8d348cec97152dafd2b88 from libvirt-glib. Original author: Michal Privoznik <mprivozn@redhat.com> Related to: rhbz#1243228 (cherry picked from commit 7805b67b68aba43afb7f421f76cf0c49afa3ea06)
-rw-r--r--src/virt-viewer-events.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/virt-viewer-events.c b/src/virt-viewer-events.c
index 02b7216..462ce6c 100644
--- a/src/virt-viewer-events.c
+++ b/src/virt-viewer-events.c
@@ -349,7 +349,7 @@ virt_viewer_events_update_timeout(int timer,
if (interval >= 0) {
if (data->source)
- goto cleanup;
+ g_source_remove(data->source);
data->interval = interval;
data->source = g_timeout_add(data->interval,