Author Topic: [v1.7.3.1] Inline Function editor does not clear CommandsStopped events  (Read 1531 times)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
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.
Code: [Select]
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
« Last Edit: February 17, 2019, 12:43:22 AM by Pfeil »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: [v1.7.3.1] Inline Function editor does not clear CommandsStopped events
« Reply #1 on: February 13, 2019, 11:48:09 PM »
Thanks, man.  I think that's fixed up now.