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:
@@ -494,9 +494,14 @@ static void script_log(void *, obs_script_t *script, int log_level,
|
||||
const char *message)
|
||||
{
|
||||
QString qmsg;
|
||||
qmsg = QStringLiteral("[%1] %2").arg(
|
||||
obs_script_get_file(script),
|
||||
message);
|
||||
|
||||
if (script) {
|
||||
qmsg = QStringLiteral("[%1] %2").arg(
|
||||
obs_script_get_file(script),
|
||||
message);
|
||||
} else {
|
||||
qmsg = QStringLiteral("[Unknown Script] %1").arg(message);
|
||||
}
|
||||
|
||||
QMetaObject::invokeMethod(scriptLogWindow, "AddLogMsg",
|
||||
Q_ARG(int, log_level),
|
||||
|
Reference in New Issue
Block a user