From 0480edce2a834b9fa1e92999341126699b28f208 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Fri, 18 Sep 2020 21:52:45 -0400 Subject: [PATCH] Clarify need for WeakSet --- cps/db.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cps/db.py b/cps/db.py index 66795f7e..891b43a3 100644 --- a/cps/db.py +++ b/cps/db.py @@ -413,9 +413,10 @@ class AlchemyEncoder(json.JSONEncoder): class CalibreDB(): _init = False engine = None - log = None # todo: ??? this isn't used, and even then, not sure if it's supposed to be per session or what config = None session_factory = None + # This is a WeakSet so that references here don't keep other CalibreDB + # instances alive once they reach the end of their respective scopes instances = WeakSet() def __init__(self):