]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Use Py_TPFLAGS_HAVE_GC for Row
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 24 Jun 2021 13:12:31 +0000 (09:12 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 24 Jun 2021 13:12:31 +0000 (09:12 -0400)
commit421d5ec0be06e5f53607a1f3dd1f46367e67cdef
treea1b8ce3ff5b62958409cc03554c29db7515994fb
parentb2b23b00b70dceb2e76c804898d7bfa7b82e48c5
Use Py_TPFLAGS_HAVE_GC for Row

Fixed an issue in the C extension for the :class:`_result.Row` class which
could lead to a memory leak in the unlikely case of a :class:`_result.Row`
object which referred to an ORM object that then was mutated to refer back
to the ``Row`` itself, creating a cycle. The Python C APIs for tracking GC
cycles has been added to the native :class:`_result.Row` implementation to
accommodate for this case.

Fixes: #5348
Change-Id: I3ac32012f29fbb59f8921cf2a124fa3a7ac5f0d1
doc/build/changelog/unreleased_14/5348.rst [new file with mode: 0644]
lib/sqlalchemy/cextension/resultproxy.c
test/aaa_profiling/test_memusage.py