Skip to content

Commit 6ba51a9

Browse files
author
Roberto De Ioris
committed
fixed gil in automation module
1 parent 8790915 commit 6ba51a9

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

Source/PythonAutomation/Private/PythonAutomationModule.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ IMPLEMENT_MODULE(FPythonAutomationModule, PythonAutomation);
99

1010
void FPythonAutomationModule::StartupModule()
1111
{
12-
PyObject *py_automation_module = ue_py_register_module((char *)"unreal_engine.automation");
12+
FScopePythonGIL gil;
13+
PyObject *py_automation_module = ue_py_register_module("unreal_engine.automation");
1314
ue_python_init_fautomation_editor_common_utils(py_automation_module);
1415
}
1516

Source/UnrealEnginePython/Private/UnrealEnginePython.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ void ue_py_register_magic_module(char *name, PyObject *(*func)())
679679
PyDict_SetItemString(py_sys_modules, name, u_module);
680680
}
681681

682-
PyObject *ue_py_register_module(char *name)
682+
PyObject *ue_py_register_module(const char *name)
683683
{
684684
return PyImport_AddModule(name);
685685
}

Source/UnrealEnginePython/Public/UnrealEnginePython.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ typedef struct
4949
} ue_PyUObject;
5050

5151
UNREALENGINEPYTHON_API void ue_py_register_magic_module(char *name, PyObject *(*)());
52-
UNREALENGINEPYTHON_API PyObject *ue_py_register_module(char *);
52+
UNREALENGINEPYTHON_API PyObject *ue_py_register_module(const char *);
5353

5454
#if ENGINE_MINOR_VERSION >= 18
5555
#define FStringAssetReference FSoftObjectPath

0 commit comments

Comments
 (0)