This commit is contained in:
Wim Pomp
2023-11-07 16:51:02 +01:00
parent f22b682b2a
commit 098d1810c3
2 changed files with 5 additions and 2 deletions

View File

@@ -81,7 +81,10 @@ class SharedMemory(UserDict):
def garbage_collect(self):
""" clean up the cache """
for item_id in set(self.cache) - set(self.data.keys()):
if item_id in self.references:
self.references[item_id] -= 1
else:
self.references[item_id] = 0
if self.trash_can is not None and item_id not in self.trash_can:
self.trash_can[item_id] = self.cache[item_id]
del self.cache[item_id]

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "parfor"
version = "2023.11.0"
version = "2023.11.1"
description = "A package to mimic the use of parfor as done in Matlab."
authors = ["Wim Pomp <wimpomp@gmail.com>"]
license = "GPLv3"