What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

How to dispose properly of tasks

deityslayer

New Member
Joined
May 18, 2014
Messages
23
Reaction score
0
Hi, I finished making a complex script.

However, I want to know how to properly dispose of a task that I started.
Currently, I'm relying on changing a variable or bool to false or 0 in order to stop a task.

But, I want to know how to dispose of the task..

To start the task, I use
new Task(() => { LootMobs(); }).Start();

but I can't dispose of the task...
I tried
new Task(() => { LootMobs(); }).Dispose();
LootMobs.Dispose();
but these don't work.
 
Back
Top