浏览代码

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.
jp9000 7 年之前
父节点
当前提交
c7c5bb999a
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      deps/obs-scripting/obs-scripting-lua.c

+ 2 - 0
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);
 
 	/* --------------------------------- */