Parcourir la source

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

Matthias Ladkau il y a 4 ans
Parent
commit
981956ff93
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  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
 }