Skip to content

Commit 4c47cbc

Browse files
author
Roberto De Ioris
committed
multithreading for commandlets
1 parent 8b26a21 commit 4c47cbc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Source/UnrealEnginePython/Private/PyCommandlet.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,16 @@ int32 UPyCommandlet::Main(const FString& CommandLine)
9494
strcpy_s(argv[i], PyArgv[i].Len() + 1, TCHAR_TO_UTF8(*PyArgv[i].ReplaceEscapedCharWithChar()));
9595
#endif
9696
#endif
97-
}
97+
}
9898

9999
PySys_SetArgv(PyArgv.Num(), argv);
100100

101+
Py_BEGIN_ALLOW_THREADS;
102+
101103
FUnrealEnginePythonModule &PythonModule = FModuleManager::GetModuleChecked<FUnrealEnginePythonModule>("UnrealEnginePython");
102104
PythonModule.BrutalFinalize = true;
103105
PythonModule.RunFile(TCHAR_TO_UTF8(*Filepath));
106+
107+
Py_END_ALLOW_THREADS;
104108
return 0;
105109
}

0 commit comments

Comments
 (0)