lundi 30 mars 2015

Should I kill unfinished task in Windows Forms

In Windows Forms project I have the form that runs some task on the button click like this:



private void button_Click(object sender, EventArgs e)
{
new Task(() => { DoSomeCalculations(); }).Start();
}


Suppose that the user close this form earlier than the task completed. Should I somehow kill unfinished task or will it finished automatically? Will application crash in this case or smth like this?


Thanks in advance.


Aucun commentaire:

Enregistrer un commentaire