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

fix: Stopping and starting the processor when loading the initial file.

Matthias Ladkau преди 4 години
родител
ревизия
981956ff93
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  1. 5 0
      cli/tool/interpret.go

+ 5 - 0
cli/tool/interpret.go

@@ -177,6 +177,9 @@ LoadInitialFile clears the global scope and reloads the initial file.
 func (i *CLIInterpreter) LoadInitialFile(tid uint64) error {
 	var err error
 
+	i.RuntimeProvider.Processor.Finish()
+	i.RuntimeProvider.Processor.Reset()
+
 	if i.CustomHandler != nil {
 		i.CustomHandler.LoadInitialFile(tid)
 	}
@@ -203,6 +206,8 @@ func (i *CLIInterpreter) LoadInitialFile(tid uint64) error {
 		}
 	}
 
+	i.RuntimeProvider.Processor.Start()
+
 	return err
 }