Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
Open
Description
The sqlite3 Connection object creates a list to hold weakrefs to Cursors, and each cursor registers itself in that list when it's created.
cpython/Modules/_sqlite/connection.c
Lines 289 to 293 inb625601
| PyObject*cursors=PyList_New(0); | |
| if (cursors==NULL) { | |
| Py_DECREF(statement_cache); | |
| gotoerror; | |
| } |
cpython/Modules/_sqlite/cursor.c
Lines 108 to 122 inb625601
| register_cursor(pysqlite_Connection*connection,PyObject*cursor) | |
| { | |
| PyObject*weakref=PyWeakref_NewRef((PyObject*)cursor,NULL); | |
| if (weakref==NULL) { | |
| return0; | |
| } | |
| if (PyList_Append(connection->cursors,weakref)<0) { | |
| Py_CLEAR(weakref); | |
| return0; | |
| } | |
| Py_DECREF(weakref); | |
| return1; | |
| } |
There's code to periodically clear out dead weakrefs from the list, but nothing I can see that actually uses it. It looks like the use was removed in#26026.
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status
No status