fix retain cycle caused by col.tr

We can't use a weakref.proxy with a method, so manually proxy the
call instead.
This commit is contained in:
Damien Elmes 2020-03-05 09:45:51 +10:00
parent 6bc3462700
commit 6b204274c0

View File

@ -83,7 +83,6 @@ class _Collection:
log: bool = False,
) -> None:
self.backend = backend
self.tr = backend.translate
self._debugLog = log
self.db = db
self.path = db._path
@ -112,6 +111,9 @@ class _Collection:
n = os.path.splitext(os.path.basename(self.path))[0]
return n
def tr(self, key: TR, **kwargs: Union[str, int, float]) -> str:
return self.backend.translate(key, **kwargs)
# Scheduler
##########################################################################