summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/annotation.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-12-27 15:02:31 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2019-12-30 14:07:18 -0500
commit04fbb9e63c098dd2de40b545eed210dfd93893ce (patch)
treef509e09f71c9a382b2d7934cf81262ad019df377 /lib/sqlalchemy/sql/annotation.py
parent9d4a58d35c53484a1de66396139fc34cd65f5be8 (diff)
downloadsqlalchemy-04fbb9e63c098dd2de40b545eed210dfd93893ce.tar.gz
Test for short term reference cycles and resolve as many as possible
Added test support and repaired a wide variety of unnecessary reference cycles created for short-lived objects, mostly in the area of ORM queries. Fixes: #5056 Change-Id: Ifd93856eba550483f95f9ae63d49f36ab068b85a
Diffstat (limited to 'lib/sqlalchemy/sql/annotation.py')
-rw-r--r--lib/sqlalchemy/sql/annotation.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/annotation.py b/lib/sqlalchemy/sql/annotation.py
index 9853cef2a..447bbe667 100644
--- a/lib/sqlalchemy/sql/annotation.py
+++ b/lib/sqlalchemy/sql/annotation.py
@@ -247,6 +247,7 @@ def _deep_annotate(element, annotations, exclude=None):
if element is not None:
element = clone(element)
+ clone = None # remove gc cycles
return element
@@ -271,6 +272,7 @@ def _deep_deannotate(element, values=None):
if element is not None:
element = clone(element)
+ clone = None # remove gc cycles
return element