sholloway / agents-playground

MIT License
4 stars 0 forks source link

Fixed memory leaks related to closing the simulation window. #48

Closed sholloway closed 1 year ago

sholloway commented 1 year ago

When I added the lru_cache to the Navigator class I realized that memory wasn't being released the way I expected when a simulation window is closed. I fixed this by adding purge methods to the memory expensive objects and logging when objects are destroyed.

Now the __handle_simclosed method on the Simulation class ensures that the SimLoop thread is indeed stopped and all container instances (e.g. the TaskScheduler, PollingQueue, dict, etc) are manually cleared.