Strange code in Task.Stop()

Oct 18, 2010 at 2:54 PM

Sorry if I missed something, but I had an exception in Windows 7 64-bit when I call the Stop() method of a Tasko object. When I look into Task.Stop() implementation I found the following code:

public void Stop()
{
    if (v2Task != null)
        v2Task.Stop(0);
     v1Task.Terminate();
}

Note that v1Task.Termiate() is called always even if v2Task is not null.
Locally I fixed it by putting "else" before v1Task.Terminate();
Please clarify if my fix is right, or v1Task.Terminate() really should be called always.
Best regards,
Sergey
Coordinator
Oct 18, 2010 at 5:24 PM

Great catch. I have updated the code with your fix.