Yumm, garbage. Someone care to explain to me what all the garbage collection features GS2 has?
Also, do references exist in GS2? For example, say you do this:
PHP Code:
n = new TStaticVar();
So, a variable n is created; a TStaticVar() is also created, in the memory of the server/client. Let's call the memory address 102 (an example). So n holds a reference to address 102. Now what if we do this:
PHP Code:
n.var1 = "blah";
x = n;
Now will x have a reference to 102? Or does it create a new TStaticVar, and then copy the vars? What if I were to do something like this?
PHP Code:
//#CLIENTSIDE
function onCreated()
{
x = new TStaticVar();
y = x;
y.var1 = "blah";
echo( x.var1 );
}
What does that echo? I can't get on RC now, and I probably won't be able to for a while.
Can anyone please clear this up for me?
Then, if I go:
PHP Code:
x = NULL; // Not destroying the object, dropping the reference
y = NULL; // Likewise
// Now, as all references are dropped, is the TStaticVar dropped from the memory (collected by garbage collection)?
Thanks,
Chris Zakuto
PS: Yes, I'm a Java geek.