sim: ensure clean IPC shutdown

This commit is contained in:
Sebastien Bourdeauducq 2012-08-05 00:16:11 +02:00
parent 47c341ecdf
commit 5bf19c155f
2 changed files with 4 additions and 0 deletions

View file

@ -66,6 +66,7 @@ def main():
fragment = autofragment.from_local() fragment = autofragment.from_local()
sim = Simulator(fragment, Runner()) sim = Simulator(fragment, Runner())
sim.run(100) sim.run(100)
del sim
in_signals += tb.inputs in_signals += tb.inputs
out_signals += tb.outputs out_signals += tb.outputs

View file

@ -158,6 +158,9 @@ class Simulator:
for k, v in value.items(): for k, v in value.items():
self.multiwrite(getattr(obj, k), v) self.multiwrite(getattr(obj, k), v)
def __del__(self):
del self.ipc
del self.sim_runner
# Contrary to multiread/multiwrite, Proxy fetches the necessary signals only and # Contrary to multiread/multiwrite, Proxy fetches the necessary signals only and
# immediately forwards writes into the simulation. # immediately forwards writes into the simulation.