util.watchdog: Pass watchdog object to callback so that it doesn't always have to be a closure
authorMatthew Wild <mwild1@gmail.com>
Fri, 18 May 2012 04:22:51 +0100
changeset 4891 189cfe565d03
parent 4890 7d4ec9609957
child 4892 6c8074f47ca4
util.watchdog: Pass watchdog object to callback so that it doesn't always have to be a closure
util/watchdog.lua
--- a/util/watchdog.lua	Fri May 18 01:50:51 2012 +0100
+++ b/util/watchdog.lua	Fri May 18 04:22:51 2012 +0100
@@ -16,7 +16,7 @@
 		end
 		local time_left = (last_reset + timeout) - current_time;
 		if time_left < 0 then
-			return watchdog.callback();
+			return watchdog:callback();
 		end
 		return time_left + 1;
 	end);