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:
parent
6bc3462700
commit
6b204274c0
@ -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
|
||||
##########################################################################
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user