fix for pool cleanup
This commit is contained in:
parent
0223f1cb38
commit
c2bcda6260
|
|
@ -101,9 +101,10 @@ class Pool:
|
|||
cleanupFunc will be called on every free and used item.
|
||||
"""
|
||||
if cleanupFunc:
|
||||
for item in self.__free:
|
||||
cleanupFunc(item)
|
||||
for item in self.__used:
|
||||
# Make a list of all the items first in case the act of
|
||||
# calling cleanupFunc moves some from used to free.
|
||||
allItems = self.__free + self.__used
|
||||
for item in allItems:
|
||||
cleanupFunc(item)
|
||||
del self.__free
|
||||
del self.__used
|
||||
|
|
|
|||
Loading…
Reference in New Issue