]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Strong reference listen function wrapped by "once"
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 3 Aug 2019 03:20:06 +0000 (23:20 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 4 Aug 2019 16:40:11 +0000 (12:40 -0400)
commite22d2b089fad1f79d53bc6238626f32f0e796ad0
tree46997483eceb659d61b4bc00033624a7aef4b999
parenta4e0995dc817acda7d669b8925c9bc3defdb660b
Strong reference listen function wrapped by "once"

Fixed issue in event system where using the ``once=True`` flag with
dynamically generated listener functions would cause event registration of
future events to fail if those listener functions were garbage collected
after they were used, due to an assumption that a listened function is
strongly referenced.  The "once" wrapped is now modified to strongly
reference the inner function persistently, and documentation is updated
that using "once" does not imply automatic de-registration of listener
functions.

Fixes: #4794
Change-Id: I06388083d1633dcc89e8919eb1e51270f966df38
doc/build/changelog/unreleased_13/4794.rst [new file with mode: 0644]
lib/sqlalchemy/event/api.py
lib/sqlalchemy/util/langhelpers.py
test/base/test_events.py