[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

Petr Viktorin report at bugs.python.org
Tue Aug 31 07:40:23 EDT 2021


Petr Viktorin <encukou at gmail.com> added the comment:

Here's a gotcha you might not be aware of:
`create_callback_context` stashes away a pointer to `state`. I don't think we can prove that the `state` will always outlive the callback_context after it'll become possible to deallocate the module

The state doesn't have a refcount, but it is owned by a module object, so callback_context should own a reference to the module object.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42064>
_______________________________________


More information about the Python-bugs-list mailing list