mirror of
https://github.com/python/cpython
synced 2026-09-29 11:30:29 +03:00
GH-92804: Fix memory leak in memoryview iterator (gh-92805)
This commit is contained in:
parent
2e8f721c0f
commit
d923fdf54b
3 changed files with 6 additions and 3 deletions
|
|
@ -3156,7 +3156,7 @@ static PyMethodDef memory_methods[] = {
|
|||
/* Memoryview Iterator */
|
||||
/**************************************************************************/
|
||||
|
||||
static PyTypeObject PyMemoryIter_Type;
|
||||
PyTypeObject _PyMemoryIter_Type;
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
|
|
@ -3233,7 +3233,7 @@ memory_iter(PyObject *seq)
|
|||
}
|
||||
|
||||
memoryiterobject *it;
|
||||
it = PyObject_GC_New(memoryiterobject, &PyMemoryIter_Type);
|
||||
it = PyObject_GC_New(memoryiterobject, &_PyMemoryIter_Type);
|
||||
if (it == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -3246,7 +3246,7 @@ memory_iter(PyObject *seq)
|
|||
return (PyObject *)it;
|
||||
}
|
||||
|
||||
static PyTypeObject PyMemoryIter_Type = {
|
||||
PyTypeObject _PyMemoryIter_Type = {
|
||||
PyVarObject_HEAD_INIT(&PyType_Type, 0)
|
||||
.tp_name = "memory_iterator",
|
||||
.tp_basicsize = sizeof(memoryiterobject),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue