]> Dogcows Code - chaz/openbox/blobdiff - openbox/mainloop.c
friendly check for the timer's delay being > 0
[chaz/openbox] / openbox / mainloop.c
index f78f5b128ed39a31d21a266ea407bbba59cc1043..b2921207b45ab716b4263c433f2d41ed0624b662 100644 (file)
@@ -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;
This page took 0.022259 seconds and 4 git commands to generate.