ParkourPenguin I post too much
Reputation: 150 Joined: 06 Jul 2014 Posts: 4652
|
Posted: Sat May 21, 2016 9:58 am Post subject: |
|
|
That won't give you all the created Lua forms if you assign two forms to the same global variable (or if you don't store the form in a global variable). Take this code as an example:
Code: | -- creates a copy of the current _ENV
local bak = {}
for k,v in pairs(_ENV) do
bak[k] = v
end
-- makes a form
createForm()
-- compares the current _ENV with the copy and prints any differences
for k,v in pairs(_ENV) do
if not (bak[k] and bak[k] == v) then
print("k:",k,"\tv:",type(v))
end
end |
This prints out nothing because no new global variables were added; however, it still created the form, and the memory that form takes up still exists. Just be careful with what you do and always destroy the stuff you don't need any more. _________________ I don't know where I'm going, but I'll figure it out when I get there.
|
|