deps/obs-scripting: Allow NULL script with script_log

(This commit also modifies the frontend-tools module)

Prevents a potential crash when script_log is called by a thread spawned
by a python library.
This commit is contained in:
jp9000
2018-01-31 16:20:45 -08:00
parent c87597f7d6
commit a2ae16e98c
3 changed files with 24 additions and 10 deletions
+5 -1
View File
@@ -1193,7 +1193,11 @@ static PyObject *py_script_log_internal(PyObject *self, PyObject *args,
while (endl) {
*endl = 0;
script_log(&cur_python_script->base, log_level, "%s", start);
if (cur_python_script)
script_log(&cur_python_script->base, log_level, "%s",
start);
else
script_log(NULL, log_level, "%s", start);
*endl = '\n';
start = endl + 1;