Do I need to cancel my task.spawns?

Pretty simple, honestly. Is it a memory leak to not cancel my task.spawns once I’m done with them? What is the best method to discontinue them if so? Thanks in advance.

1 Like

When a task has finished running, if there are no references held to it within your code it will be automatically cleared from memory by Lua’s garbage collector. You should only need to use task.cancel() when stopping a task which is actively running code.

As long as you release any references to a task when it has finished running, memory will not be wasted.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.