diff options
author | Max Kellermann <max@duempel.org> | 2013-01-10 19:08:42 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-14 11:12:28 +0100 |
commit | d3a479b7fa1d1e52f9d3950139643fe7e3ff5a57 (patch) | |
tree | 4996c42d621876770a6d80bc8d031be9ee97676a /src/event/Loop.hxx | |
parent | 92fb0e829a9b61d1b1db4bdbe6096c1772b7c819 (diff) | |
download | mpd-d3a479b7fa1d1e52f9d3950139643fe7e3ff5a57.tar.gz mpd-d3a479b7fa1d1e52f9d3950139643fe7e3ff5a57.tar.xz mpd-d3a479b7fa1d1e52f9d3950139643fe7e3ff5a57.zip |
event/TimeoutMonitor: wrapper for g_timeout_source_new()
Diffstat (limited to 'src/event/Loop.hxx')
-rw-r--r-- | src/event/Loop.hxx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/event/Loop.hxx b/src/event/Loop.hxx index 9c139e08e..31ef1613c 100644 --- a/src/event/Loop.hxx +++ b/src/event/Loop.hxx @@ -64,22 +64,20 @@ public: return id; } - guint AddTimeout(guint interval_ms, - GSourceFunc function, gpointer data) { + GSource *AddTimeout(guint interval_ms, + GSourceFunc function, gpointer data) { GSource *source = g_timeout_source_new(interval_ms); g_source_set_callback(source, function, data, nullptr); - guint id = g_source_attach(source, GetContext()); - g_source_unref(source); - return id; + g_source_attach(source, GetContext()); + return source; } - guint AddTimeoutSeconds(guint interval_s, - GSourceFunc function, gpointer data) { + GSource *AddTimeoutSeconds(guint interval_s, + GSourceFunc function, gpointer data) { GSource *source = g_timeout_source_new_seconds(interval_s); g_source_set_callback(source, function, data, nullptr); - guint id = g_source_attach(source, GetContext()); - g_source_unref(source); - return id; + g_source_attach(source, GetContext()); + return source; } }; |