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.
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.