diff --git a/neuropercolation/display.py b/neuropercolation/display.py index 79a403d..19ee899 100644 --- a/neuropercolation/display.py +++ b/neuropercolation/display.py @@ -109,7 +109,10 @@ class CAWindow: draw_duration=(time_ds_end - time_ca_end), evolution_step=self._cellular_automaton.evolution_step) self._sleep_to_keep_rate(time.time() - time_ca_start, evolutions_per_second) - + try: + self.__draw_engine._pygame.quit() + except: + print('Failed to quit pygame') def _sleep_to_keep_rate(self, time_taken, evolutions_per_second): # pragma: no cover if evolutions_per_second > 0: rest_time = 1.0 / evolutions_per_second - time_taken