Skip to content

Commit 2d405ba

Browse files
committed
CodeQL findings
1 parent 5eb32f8 commit 2d405ba

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

libsrc/effectengine/EffectModule.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,6 @@ static int hyperion_exec(PyObject* module) {
3838
return 0;
3939
}
4040

41-
// Module creation function for multi-phase init, used in Py_mod_create slot
42-
static PyObject* hyperion_create(PyModuleDef* def, PyObject* args) {
43-
PyObject* module = PyModule_Create(def);
44-
if (!module)
45-
{
46-
return NULL;
47-
}
48-
49-
// Execute any additional module initialization logic
50-
if (hyperion_exec(module) < 0)
51-
{
52-
Py_DECREF(module);
53-
return NULL;
54-
}
55-
56-
return module;
57-
}
58-
5941
// Module deallocation function to clean up per-interpreter state
6042
static void hyperion_free(void* /* module */)
6143
{

libsrc/python/PythonProgram.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ void PythonProgram::execute(const QByteArray& python_code)
8181
{
8282
return;
8383
}
84-
84+
#if (PY_VERSION_HEX < 0x030C0000)
85+
PyThreadState_Swap(_tstate);
86+
#else
8587
PyThreadState* prev_thread_state = PyThreadState_Swap(_tstate);
86-
88+
#endif
8789
PyObject* main_module = PyImport_ImportModule("__main__");
8890
if (!main_module)
8991
{

0 commit comments

Comments
 (0)