Application
(1)
Control
(1)
Visual
(1)
IDisposable
(1)
Dispose
(1)
GC
(1)
Sakowicz
(1)
Michał
(1)

Generic list & dispose

Asked By =?ISO-8859-2?Q?Micha=B3_Sakowicz?=
04-Dec-07 02:53 AM
Hi,

I have quick question, I've created user control which is using
generic lists internally. Should I implement IDisposable pattern to
release memory taken by those lists, or should I leave it as it is and
let GC do its job? I'm not using any unmanaged resources.

Thanks
Michal

I wouldn't bother. It will be GC'd when appropriate.

Asked By Peter Morris
03-Dec-07 08:45 AM
I would not bother.  It will be GC'd when appropriate.  You could, if you
wish, clear the list from the Dispose() method on your control.



Pete

It is good practice to especially if the list is large and don't forget this

Asked By srharton
03-Dec-07 02:23 PM
It is good practice to especially if the list is large and don't forget this
is running on a memory contrained device. It is better to clear memory as
soon as possible IMO. As Peter suggested, implement the IDisposable on the
Control and in the Dispose method clear the list from there.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com

Thanks a lot!Michal

Asked By =?ISO-8859-2?Q?Micha=B3_Sakowicz?=
07-Dec-07 01:50 AM
Thanks a lot!

Michal
Post Question To EggHeadCafe