From c7c5bb999a61c74bc6986eeeebc98d11475c82af Mon Sep 17 00:00:00 2001 From: jp9000 Date: Thu, 1 Feb 2018 20:01:46 -0800 Subject: [PATCH] deps/obs-scripting: Fix cur. script being NULL for script_tick Fixes a bug where the thread local variable "current_lua_script" is not set when calling script_tick. --- deps/obs-scripting/obs-scripting-lua.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deps/obs-scripting/obs-scripting-lua.c b/deps/obs-scripting/obs-scripting-lua.c index f6023454c..965e7e132 100644 --- a/deps/obs-scripting/obs-scripting-lua.c +++ b/deps/obs-scripting/obs-scripting-lua.c @@ -1023,6 +1023,7 @@ static void lua_tick(void *param, float seconds) data = first_tick_script; while (data) { lua_State *script = data->script; + current_lua_script = data; pthread_mutex_lock(&data->mutex); @@ -1033,6 +1034,7 @@ static void lua_tick(void *param, float seconds) data = data->next_tick; } + current_lua_script = NULL; pthread_mutex_unlock(&tick_mutex); /* --------------------------------- */