mirror of
https://github.com/thp/pyotherside.git
synced 2025-01-28 23:52:55 +08:00
Do not decref PySys_GetObject return values (Fixes #84)
The function PySys_GetObject() returns a borrowed reference only, so we must incref/decref the value accordingly, and not take ownership of the returned value. https://docs.python.org/3/c-api/sys.html#c.PySys_GetObject
This commit is contained in:
parent
b435941e51
commit
d1e329048a
@ -652,7 +652,7 @@ QPythonPriv::instance()
|
||||
QString
|
||||
QPythonPriv::importFromQRC(const char *module, const QString &filename)
|
||||
{
|
||||
PyObjectRef sys_modules(PySys_GetObject((char *)"modules"), true);
|
||||
PyObjectRef sys_modules(PySys_GetObject((char *)"modules"));
|
||||
if (!PyMapping_Check(sys_modules.borrow())) {
|
||||
return QString("sys.modules is not a mapping object");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user