Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #27695
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Is it necessary to explicitly destroy elements? |
| Date | 2015-05-16 18:12 +0200 |
| Organization | PointedEars Software (PES) |
| Message-ID | <8185458.TY0rIKgSsa@PointedEars.de> (permalink) |
| References | <mj7odj$ejr$1@dont-email.me> <GC-20150516175759@ram.dialup.fu-berlin.de> <mj7q18$kkp$1@dont-email.me> |
Leonardo Azpurua wrote:
> "Stefan Ram" […]
>> "Leonardo Azpurua" <leonardo@exmvps.org> writes:
>>> […] do most "modern" browsers (say FireFox, Chrome, IE9+, Opera, Safari)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>> automatically handle all the cleanup of a disposed element (detaching
>>> event handlers, freeing graphical resources, deallocating memory, etc)
>>> for all the elemets inside a disposed control, or is it necessary to
>>> provide a function to handle all of it explicitly?
>>
>> The garbage collectors should take care of JavaScript objects and of
>> DOM objects. But some collectors cannot clean up in all situations.
>> To be on the safe side:
>>
>> - avoid circular references between JavaScript objects and DOM objects
>> - avoid using closure variables in event handlers
>> - avoid using inline event handlers (onclick='f()')
>> - avoid using expando properties
>> - nullify expando properties and DOM references when not needed anymore
>
> Nice!
And wrong.
--
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Is it necessary to explicitly destroy elements? "Leonardo Azpurua" <leonardo@exmvps.org> - 2015-05-16 11:14 -0430
Re: Is it necessary to explicitly destroy elements? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-16 17:44 +0200
Re: Is it necessary to explicitly destroy elements? "Leonardo Azpurua" <leonardo@exmvps.org> - 2015-05-16 11:32 -0430
Re: Is it necessary to explicitly destroy elements? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-16 18:06 +0200
Re: Is it necessary to explicitly destroy elements? "Leonardo Azpurua" <leonardo@exmvps.org> - 2015-05-16 11:42 -0430
Re: Is it necessary to explicitly destroy elements? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-16 18:12 +0200
Re: Is it necessary to explicitly destroy elements? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-16 18:09 +0200
Re: Is it necessary to explicitly destroy elements? Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-05-16 22:05 -0300
Re: Is it necessary to explicitly destroy elements? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-17 08:01 +0200
Re: Is it necessary to explicitly destroy elements? Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-05-17 13:29 -0300
Re: Is it necessary to explicitly destroy elements? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-17 19:06 +0200
Re: Is it necessary to explicitly destroy elements? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-05-17 11:53 +0200
Re: Is it necessary to explicitly destroy elements? Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-05-17 13:20 -0300
csiph-web