diff --git a/Source/PythonAutomation/Private/PythonAutomationModule.cpp b/Source/PythonAutomation/Private/PythonAutomationModule.cpp index 498670948..063581df7 100644 --- a/Source/PythonAutomation/Private/PythonAutomationModule.cpp +++ b/Source/PythonAutomation/Private/PythonAutomationModule.cpp @@ -9,7 +9,8 @@ IMPLEMENT_MODULE(FPythonAutomationModule, PythonAutomation); void FPythonAutomationModule::StartupModule() { - PyObject *py_automation_module = ue_py_register_module((char *)"unreal_engine.automation"); + FScopePythonGIL gil; + PyObject *py_automation_module = ue_py_register_module("unreal_engine.automation"); ue_python_init_fautomation_editor_common_utils(py_automation_module); } diff --git a/Source/UnrealEnginePython/Private/UnrealEnginePython.cpp b/Source/UnrealEnginePython/Private/UnrealEnginePython.cpp index 005e2ac6c..a10a4870b 100644 --- a/Source/UnrealEnginePython/Private/UnrealEnginePython.cpp +++ b/Source/UnrealEnginePython/Private/UnrealEnginePython.cpp @@ -679,7 +679,7 @@ void ue_py_register_magic_module(char *name, PyObject *(*func)()) PyDict_SetItemString(py_sys_modules, name, u_module); } -PyObject *ue_py_register_module(char *name) +PyObject *ue_py_register_module(const char *name) { return PyImport_AddModule(name); } diff --git a/Source/UnrealEnginePython/Public/UnrealEnginePython.h b/Source/UnrealEnginePython/Public/UnrealEnginePython.h index c65364bb2..6e1e4eab0 100644 --- a/Source/UnrealEnginePython/Public/UnrealEnginePython.h +++ b/Source/UnrealEnginePython/Public/UnrealEnginePython.h @@ -49,7 +49,7 @@ typedef struct } ue_PyUObject; UNREALENGINEPYTHON_API void ue_py_register_magic_module(char *name, PyObject *(*)()); -UNREALENGINEPYTHON_API PyObject *ue_py_register_module(char *); +UNREALENGINEPYTHON_API PyObject *ue_py_register_module(const char *); #if ENGINE_MINOR_VERSION >= 18 #define FStringAssetReference FSoftObjectPath