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

sqlite3 Connection maintains an unused list of weakrefs to Cursor objects #144377

@takluyver

Description

@takluyver

The sqlite3 Connection object creates a list to hold weakrefs to Cursors, and each cursor registers itself in that list when it's created.

PyObject*cursors=PyList_New(0);
if (cursors==NULL) {
Py_DECREF(statement_cache);
gotoerror;
}

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

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp