0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-19 20:32:15 +02:00

deps/obs-scripting: Fix crash removing callbacks in script_unload

Signed-off-by: Ilya Chernikov <chernikov.i123@gmail.com>
This commit is contained in:
Ilya Chernikov 2023-06-10 15:30:33 +07:00 committed by Lain
parent 1aed7ed114
commit a609cfb2f0

View File

@ -1228,10 +1228,13 @@ void obs_lua_script_unload(obs_script_t *s)
/* call script_unload */
pthread_mutex_lock(&data->mutex);
current_lua_script = data;
lua_getglobal(script, "script_unload");
lua_pcall(script, 0, 0, 0);
current_lua_script = NULL;
/* ---------------------------- */
/* remove all callbacks */