mirror of
https://gitlab.com/virt-viewer/virt-viewer.git
synced 2025-01-10 01:17:47 +03:00
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
This commit is contained in:
parent
a7050b7d2c
commit
7805b67b68
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user