Skip to content

Commit ab0f6de

Browse files
chrisswinchatt-armsaheerb
authored andcommitted
Ensure the fast model shuts down when FastmodelAgent is destroyed
1 parent 003505d commit ab0f6de

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fm_agent/fm_agent.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import sys
2020
import os
21+
from subprocess import Popen
2122
import time
2223
import socket
2324
from .utils import *
@@ -55,6 +56,10 @@ def __init__(self, model_name=None, model_config=None, logger=None, enable_gdbse
5556
else:
5657
pass
5758

59+
def __del__(self):
60+
if isinstance(self.subprocess, Popen):
61+
self.subprocess.kill()
62+
5863
def setup_simulator(self, model_name, model_config):
5964
""" setup the simulator, this is crucial before you can start a simulator.
6065
@param model_name is the specific model name need to be launched

0 commit comments

Comments
 (0)