Forráskód Böngészése

Close the model at the end, to make sure that types are flushed

Yentl Van Tendeloo 8 éve
szülő
commit
1b44df21f8
1 módosított fájl, 6 hozzáadás és 0 törlés
  1. 6 0
      wrappers/modelverse.py

+ 6 - 0
wrappers/modelverse.py

@@ -1014,3 +1014,9 @@ def model_types(model_name):
     _input(["model_types", model_name])
     output = _handle_output("Success: ", split=True)
     return set(output)
+
+import atexit
+def _close_model():
+    if mode == MODE_MODIFY:
+        _model_exit()
+atexit.register(_close_model)