bpo-31770: Prevent a crash and refleaks when calling sqlite3.Cursor.__init__() more than once#3968
Conversation
vstinner
left a comment
There was a problem hiding this comment.
LGTM, except of "del ref".
@serhiy-storchaka: Would you mind to double-check this PR please?
It seems like "self->in_weakreflist" is already set to NULL by the memory allocator, so it's safe to remove "self->in_weakreflist = NULL;".
Sorry, something went wrong.
|
I didn't approve the PR yet because of my question on "del ref". |
Sorry, something went wrong.
|
The line number doesn't matter for a test triggering a crash, I mean non
regression trst fixing a crash. Yes, replace the useless del with
gc_collect() please.
|
Sorry, something went wrong.
|
IIUC, calling |
Sorry, something went wrong.
…_init__() more than once (pythonGH-3968) (cherry picked from commit e56ab74)
…_init__() more than once (pythonGH-3968) (cherry picked from commit e56ab74)
…_init__() more than once (python#3968)
In addition, add a test to
test_sqliteto make sure that the crash is no more.https://bugs.python.org/issue31770