Fix for CONPY-119: Fixed memory leak

When creating a cursor with result set type named_tuple
or dictionary, references were not decremented correctly.

For named tuples we don't use a static variable anymore, instead
of it will be created by PyStructSequence_NewType.
This commit is contained in:
Georg Richter
2020-10-03 16:41:29 +02:00
parent cbd51decc6
commit 846c0d0fdb
3 changed files with 7 additions and 8 deletions

View File

@ -26,7 +26,6 @@
extern int codecs_datetime_init(void);
PyObject *Mrdb_Pickle= NULL;
PyObject *cnx_pool= NULL;
PyObject *decimal_module= NULL,
*decimal_type= NULL;
@ -165,9 +164,6 @@ PyMODINIT_FUNC PyInit__mariadb(void)
goto error;
}
/* we need pickle for object serialization */
Mrdb_Pickle= PyImport_ImportModule("pickle");
Py_TYPE(&MrdbCursor_Type) = &PyType_Type;
if (PyType_Ready(&MrdbCursor_Type) == -1)
{