Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc1926a6

Browse files
Visit and clear heap types at module level
1 parent0570ae0 commitc1926a6

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

‎Modules/_io/_iomodule.c‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,15 @@ iomodule_traverse(PyObject *mod, visitproc visit, void *arg) {
582582
return0;
583583
Py_VISIT(state->locale_module);
584584
Py_VISIT(state->unsupported_operation);
585+
586+
Py_VISIT(state->PyBufferedRWPair_Type);
587+
Py_VISIT(state->PyBufferedRandom_Type);
588+
Py_VISIT(state->PyBufferedReader_Type);
589+
Py_VISIT(state->PyBufferedWriter_Type);
590+
Py_VISIT(state->PyBytesIO_Type);
591+
Py_VISIT(state->PyFileIO_Type);
592+
Py_VISIT(state->PyStringIO_Type);
593+
Py_VISIT(state->PyTextIOWrapper_Type);
585594
return0;
586595
}
587596

@@ -594,6 +603,15 @@ iomodule_clear(PyObject *mod) {
594603
if (state->locale_module!=NULL)
595604
Py_CLEAR(state->locale_module);
596605
Py_CLEAR(state->unsupported_operation);
606+
607+
Py_CLEAR(state->PyBufferedRWPair_Type);
608+
Py_CLEAR(state->PyBufferedRandom_Type);
609+
Py_CLEAR(state->PyBufferedReader_Type);
610+
Py_CLEAR(state->PyBufferedWriter_Type);
611+
Py_CLEAR(state->PyBytesIO_Type);
612+
Py_CLEAR(state->PyFileIO_Type);
613+
Py_CLEAR(state->PyStringIO_Type);
614+
Py_CLEAR(state->PyTextIOWrapper_Type);
597615
return0;
598616
}
599617

‎Modules/_io/bufferedio.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,6 +2122,7 @@ _io_BufferedRWPair___init___impl(rwpair *self, PyObject *reader,
21222122
staticint
21232123
bufferedrwpair_traverse(rwpair*self,visitprocvisit,void*arg)
21242124
{
2125+
Py_VISIT(Py_TYPE(self));
21252126
Py_VISIT(self->dict);
21262127
return0;
21272128
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp