Преглед на файлове

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

Yentl Van Tendeloo преди 8 години
родител
ревизия
1b44df21f8
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  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)