Learning Javascript: The Next Day
Since the topic has come up, I'm also have a a close read at the way you've created your OOJS framework for ActiveWidgets.
My question for the day is this:
I saw this comment:
'// break object reference to avoid memory leak
el = null;"
and I noticed you grabbed a new reference to header.element() for all the internal functions and discarded it when you finished by setting it to null.
I was wondering what's the memory leak you refer to?
Is it something to do with the nature of closures in JS i.e. a reference to private members still exists and is available to internal functions after the outer function is completed? Does this leak memory?
My question for the day is this:
I saw this comment:
'// break object reference to avoid memory leak
el = null;"
and I noticed you grabbed a new reference to header.element() for all the internal functions and discarded it when you finished by setting it to null.
I was wondering what's the memory leak you refer to?
Is it something to do with the nature of closures in JS i.e. a reference to private members still exists and is available to internal functions after the outer function is completed? Does this leak memory?
Andrew
April 15,