From 5fdb638454ce90eb565555dfece5030a2ec4a576 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sat, 28 Mar 2020 01:09:58 +0100 Subject: Fix reference counting bug and lua timing --- backends/lua.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'backends/lua.c') diff --git a/backends/lua.c b/backends/lua.c index 127933a..e2f3b0e 100644 --- a/backends/lua.c +++ b/backends/lua.c @@ -533,7 +533,8 @@ static int lua_set(instance* inst, size_t num, channel** c, channel_value* v){ } static int lua_handle(size_t num, managed_fd* fds){ - uint64_t delta = timer_interval; + uint64_t delta = mm_timestamp() - last_timestamp; + last_timestamp = mm_timestamp(); size_t n; #ifdef MMBACKEND_LUA_TIMERFD @@ -547,9 +548,6 @@ static int lua_handle(size_t num, managed_fd* fds){ LOGPF("Failed to read timer: %s", strerror(errno)); return 1; } - #else - delta = mm_timestamp() - last_timestamp; - last_timestamp = mm_timestamp(); #endif //no timers active -- cgit v1.2.3