aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends/lua.c
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2020-03-28 01:09:58 +0100
committercbdev <cb@cbcdn.com>2020-03-28 01:09:58 +0100
commit5fdb638454ce90eb565555dfece5030a2ec4a576 (patch)
treeaad6dff626be4eac5779e5661f978ab6557e70ac /backends/lua.c
parent253125ea28925e5207c375987ac36468327bed66 (diff)
downloadmidimonster-5fdb638454ce90eb565555dfece5030a2ec4a576.tar.gz
midimonster-5fdb638454ce90eb565555dfece5030a2ec4a576.tar.bz2
midimonster-5fdb638454ce90eb565555dfece5030a2ec4a576.zip
Fix reference counting bug and lua timing
Diffstat (limited to 'backends/lua.c')
-rw-r--r--backends/lua.c6
1 files changed, 2 insertions, 4 deletions
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