Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 37 made on Tuesday April 27, 2010 at 20:32
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
13,006
On April 27, 2010 at 14:45, Dominator said...
Questions for you. 

1) Are they just marked for deletion for later garbage collection?

1. I have been told to set unused stuff to null or delete unused fields prior to returning back to system as this will aid in JS Garbage collection. I have not dug into the implementation of Spidermonkey to say for sure. However, more objects, as noted does slow this down. It is likely the latter and not the former that you should be worried about.

2) On page exit, do the dynamic objects get destroyed anyway.....in which case I don't have to clean up saving a few cycles or is it more efficient the way I'm doing it

2a. As good practice, you should always clean up your variables.

2b. Javascript scoping rules enforce that at page exit, any variables that were declared via the page script are wiped and a GC cycle will occur. This includes both the page object scope and dynamic widgets for the page as well as any functions added to them. (See 2a).
Lyndel McGee
Philips Pronto Addict/Beta Tester


Hosting Services by ipHouse