From c2bcda6260634c8c5172f353fa2ef636c9821c58 Mon Sep 17 00:00:00 2001 From: Joe Shochet Date: Thu, 4 May 2006 21:08:35 +0000 Subject: [PATCH] fix for pool cleanup --- direct/src/showbase/Pool.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/direct/src/showbase/Pool.py b/direct/src/showbase/Pool.py index 85004949ef..030b8f6de8 100755 --- a/direct/src/showbase/Pool.py +++ b/direct/src/showbase/Pool.py @@ -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