View Single Post
  #2  
Old 06-15-2008, 07:33 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
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.
__________________
Reply With Quote