When running an inline function using the editor, clicking the "Stop", "OK", or "Cancel" will stop the function, however the event handler remains in place.
E.G.
using System;
using System.Threading;
public class VAInline
{
bool stop = false;
int counter = 0;
public void main()
{
VA.CommandsStopped += stopEvent;
while (!stop)
{
Thread.Sleep(1000);
counter++;
VA.WriteToLog("count: " + counter);
}
}
void stopEvent()
{
stop = true;
VA.WriteToLog("stopped");
VA.WriteToLog("count: " + counter);
}
}
Stopping the function will stop the counter, but stopping all commands afterwards(which also occurs when reloading/changing profiles) will still run the event handler(I.E. "stopped" and the current count will be written to the log).
If the inline function has been executed multiple times through the editor, the event handler of each instance will run once commands are stopped.
EDIT: Fixed in v1.7.3.2