If the value is cleared what is left? I did a quick check with getfenv() doing what you suggested and it wasnt in the environment
An OOP class may seem like it’s got it’s own rules, but it really doesn’t, if the scope they were initialized in ends, then it behaves just like any other function or module on roblox.
A function’s scope ends when it has finished running.
That is what I meant, the value is set to nil, therefore it won’t be available. But it’s memory still remains, and will be cleared when the scope it was allocated in ends.
I’m so confused if it isnt in the environment how could I view it in memory?
Check out the Lua guide about this topic.
Setting to nil doesn’t delete it from memory right then and there. It just allows the Lua garbage collector to know that it’s garbage.
Could you quote specifically where in that thing you linked which supports what you said?
Yes. That is why I said what I said. Marking for collection, is not the same as garbage collection.
So do you have any other questions? Because to me, it seems like your question has been answered a long time ago.
That is just an demonstration on how lua garbage collector works. The Lua source code + reputable members of StackOverFlow and this forum support all what I said. You can search up more.
Well I asked where did you hear that from that you cant view it why cant you just show me what exactly you are referring to instead of using those links as proxys?
Obviously you can’t view it from memory, there is no way. You can clearly test this out your self.
It would appear that there was a bit of a misunderstanding.
This statement without the last two sentences is somewhat misleading, I apologize for that. The question that I was trying to ask here has essentially been answered by @SilentsReplacement.
In regards to the topic’s solution, I’ll pick the post that has the most answers towards the ones asked in the first post. For anybody who comes later to read this, I recommend checking out the whole topic.
data[workspace.Part] = nil
This is all you need to do, so yes it works. Also you can do things like;
local bla = {}
bla["A"] = true
function blabla()
bla = {}
end
and this will overwrite your old table with a new one so the old one will no longer exist.