mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
CodeQL findings
This commit is contained in:
parent
5eb32f852b
commit
2d405baa8a
@ -38,24 +38,6 @@ static int hyperion_exec(PyObject* module) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Module creation function for multi-phase init, used in Py_mod_create slot
|
|
||||||
static PyObject* hyperion_create(PyModuleDef* def, PyObject* args) {
|
|
||||||
PyObject* module = PyModule_Create(def);
|
|
||||||
if (!module)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute any additional module initialization logic
|
|
||||||
if (hyperion_exec(module) < 0)
|
|
||||||
{
|
|
||||||
Py_DECREF(module);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return module;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Module deallocation function to clean up per-interpreter state
|
// Module deallocation function to clean up per-interpreter state
|
||||||
static void hyperion_free(void* /* module */)
|
static void hyperion_free(void* /* module */)
|
||||||
{
|
{
|
||||||
|
@ -81,9 +81,11 @@ void PythonProgram::execute(const QByteArray& python_code)
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#if (PY_VERSION_HEX < 0x030C0000)
|
||||||
|
PyThreadState_Swap(_tstate);
|
||||||
|
#else
|
||||||
PyThreadState* prev_thread_state = PyThreadState_Swap(_tstate);
|
PyThreadState* prev_thread_state = PyThreadState_Swap(_tstate);
|
||||||
|
#endif
|
||||||
PyObject* main_module = PyImport_ImportModule("__main__");
|
PyObject* main_module = PyImport_ImportModule("__main__");
|
||||||
if (!main_module)
|
if (!main_module)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user