Garbage collecting functions

Hello, I am looking for a way to garbage collect functions that are still running. For example, tables, instances, etc. can be garbage collected by removing all references to them. How would I garbage collect a function that is still running? By running I mean that it has a loop that never ends.

Example:

local TestFunction = function()
	while true do
		warn("Running")
		task.wait(1)
	end
end

TestFunction()
-- How would I get "TestFunction" to garbage collect, although it is still running?

This community tutorial may help out:

Did you find an answer to that? Shouldn’t you just set “local TestFunction” to nil?