Hi,
I was curious when the garbage collector would clean something like this:
function testFunction ()
local testVariable = 100
local function firstFunctionInBlock ()
print("first function, testVariable: " .. testVariable )
testVariable = testVariable + 1
end
local function secondFunctionInBlock ()
print("second function, testVariable: " .. testVariable)
testVariable = testVariable + 1
end
return function () firstFunctionInBlock() secondFunctionInBlock () end
end
function testFunction () --------------------------
-- function block -- -------------