aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/io_thread.c7
-rw-r--r--src/io_thread.h3
2 files changed, 5 insertions, 5 deletions
diff --git a/src/io_thread.c b/src/io_thread.c
index fa6dee337..501cfe50a 100644
--- a/src/io_thread.c
+++ b/src/io_thread.c
@@ -123,15 +123,14 @@ io_thread_idle_add(GSourceFunc function, gpointer data)
return id;
}
-guint
+GSource *
io_thread_timeout_add_seconds(guint interval,
GSourceFunc function, gpointer data)
{
GSource *source = g_timeout_source_new_seconds(interval);
g_source_set_callback(source, function, data, NULL);
- guint id = g_source_attach(source, io.context);
- g_source_unref(source);
- return id;
+ g_source_attach(source, io.context);
+ return source;
}
struct call_data {
diff --git a/src/io_thread.h b/src/io_thread.h
index c91597225..d1a203aa3 100644
--- a/src/io_thread.h
+++ b/src/io_thread.h
@@ -62,7 +62,8 @@ io_thread_inside(void);
guint
io_thread_idle_add(GSourceFunc function, gpointer data);
-guint
+G_GNUC_MALLOC
+GSource *
io_thread_timeout_add_seconds(guint interval,
GSourceFunc function, gpointer data);