From 08359d95a3bd5b2770838959fbb53a48ff858afd Mon Sep 17 00:00:00 2001 From: user202729 <25191436+user202729@users.noreply.github.com> Date: Wed, 3 Mar 2021 18:02:46 +0700 Subject: [PATCH 1/2] Fix memory leak caused by defaultdict access in suggestions feature --- plover/steno_dictionary.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plover/steno_dictionary.py b/plover/steno_dictionary.py index d18f47706..217b5c412 100644 --- a/plover/steno_dictionary.py +++ b/plover/steno_dictionary.py @@ -157,10 +157,10 @@ def __contains__(self, key): return self.get(key) is not None def reverse_lookup(self, value): - return set(self.reverse[value]) + return set(self.reverse.get(value, ())) def casereverse_lookup(self, value): - return set(self.casereverse[value]) + return set(self.casereverse.get(value, ())) @property def _longest_key(self): From b7b0aeea9b54b0c0d2401ba2c3f6b5e793bdcf55 Mon Sep 17 00:00:00 2001 From: Ted Morin Date: Thu, 1 Apr 2021 13:40:42 -0400 Subject: [PATCH 2/2] Add news.d --- news.d/bugfix/1188.core.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 news.d/bugfix/1188.core.md diff --git a/news.d/bugfix/1188.core.md b/news.d/bugfix/1188.core.md new file mode 100644 index 000000000..0b3080f61 --- /dev/null +++ b/news.d/bugfix/1188.core.md @@ -0,0 +1 @@ +Fix unbounded memory use in the lookup functions used by the Suggestions window.