Commit a5281d31 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

python: keep event channel open until simulation object is released

parent 84b0b808
......@@ -60,6 +60,10 @@ class Simulation(_dpsim.Simulation):
if pbar:
self.show_progressbar()
def __del__(self):
self.remove_eventfd(self._event_socks[0].fileno())
self._events.close()
def add_callback(self, cb, *args, event=None):
self._events.add_callback(cb, *args, event=event)
......@@ -79,9 +83,9 @@ class Simulation(_dpsim.Simulation):
if self._pbar_tui:
self._pbar_tui.finish()
self._pbar_task.cancel()
self.remove_eventfd(self._event_socks[0].fileno())
self._events.close()
if self._pbar_task:
self._pbar_task.cancel()
LOGGER.info('Finished simulation!')
def overrun(self, *args):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment