Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-15-2008, 07:19 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
rungarbagecollector()

I was checking out a list of functions and came across this interestingly named one. Anyone know what it does?
__________________
Reply With Quote
  #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
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:34 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.