diff options
author | Christian Kellner <christian@kellner.me> | 2017-02-22 17:46:11 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2017-09-08 18:05:19 +0200 |
commit | e4b85ef5df2f48ae28ccd0a6feb6a652baf8c285 (patch) | |
tree | c1cc4793d15b8ea97f8cb4a759602ad7fd1a5840 /src | |
parent | 7171ce38d6b8e0540f7cecc828c1bbabf4bd8b91 (diff) |
daemon: more efficient poll resetting
If the poll timeout is actually changed because the warning level
has changed, only reset the actual poll code, not the warning level
notifications and the booking structures.
https://bugs.freedesktop.org/show_bug.cgi?id=99862
Diffstat (limited to 'src')
-rw-r--r-- | src/up-daemon.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/up-daemon.c b/src/up-daemon.c index b6ad3f5..1ae032f 100644 --- a/src/up-daemon.c +++ b/src/up-daemon.c @@ -777,9 +777,9 @@ change_idle_timeout (UpDevice *device, g_debug ("Resetting for polling for '%s' (warning-level change)", up_device_get_object_path (device)); + g_source_remove (data->id); data->timeout = timeout; - up_daemon_stop_poll (G_OBJECT (device)); - up_daemon_start_poll (G_OBJECT (device), callback); + enable_poll_for_device (device, data); } g_object_unref (daemon); |