Runs the garbage collector.
In Java, that means that it will go through and clear out all of the unused variables.
For example,
PHP Code:
function onCreated()
{
temp.foo = new TStaticVar();
foo.lolwat = 32;
}
temp.foo is not immediately destroyed once the onCreated function ends. Instead, the garbage collector comes and destroys it to clear memory.
So, in theory, to destroy something, remove all references to it.
PHP Code:
temp.foo = new TStaticVar();
temp.foo = null;
temp.foo no longer points to the TStaticVar created, so it will be destroyed.
This thread might help a bit as well:
http://forums.graalonline.com/forums...hlight=garbage
Quote:
Originally Posted by Stefan
When you assign a TStaticVar to a normal variable, then only a link to the TStaticVar is remembered. When there is no link to a TStaticVar anymore, then the variable will be deleted on the next run of the garabage collector.
|
Stefan said that in that thread, which is a bit easier to understand that what I said.