To fix, this would require some special handling of Python function objects in the `EventManager` — I don't want that, I wish to keep the manager agnostic to Python since I'm going to be pushing events into it from both C++ and Python. I'd like to solve this problem exclusively through the `EventManager` wrapper class I wrote.
On Tue, Aug 2, 2011 at 3:24 AM, Jim Bosch-2 [via Boost]
<[hidden email]> wrote:
Are these cycles actually a problem in practice? Python does do garbage
collection, so it might be that it knows about all these dependencies
and just hasn't bothered to try to delete them because it doesn't need
the memory yet.
Yes, they are problematic. When the object gets removed it should not receive any more events or it will very likely result in some odd behavior on the screen. These objects are entity states in a game. A state dictates how an entity reacts to game events and when the entity changes its state, the old one should stop giving the entity instructions, or they will conflict with the instructions given by the new state.