summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2008-01-16 10:31:12 -0500
committerDana Jansens <danakj@orodu.net>2008-01-16 10:31:12 -0500
commit9e18dbe0eed4f23909a0566dbc8b55b1bac470b8 (patch)
tree252778c16c4f9991fc442432a32212a51b209844
parent0be98fee4743c795b06aa23881b82eff5bab3ef6 (diff)
friendly check for the timer's delay being > 0
-rw-r--r--openbox/mainloop.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/openbox/mainloop.c b/openbox/mainloop.c
index f78f5b12..b2921207 100644
--- a/openbox/mainloop.c
+++ b/openbox/mainloop.c
@@ -530,6 +530,9 @@ void ob_main_loop_timeout_add(ObMainLoop *loop,
GDestroyNotify notify)
{
ObMainLoopTimer *t = g_new(ObMainLoopTimer, 1);
+
+ g_assert(microseconds > 0); /* if it's 0 it'll cause an infinite loop */
+
t->delay = microseconds;
t->func = handler;
t->data = data;