G
Guest
This whole dispose topic confuses me regarding managed and unmanaged
resources. I think that it was easier when you just cleaned up every object,
which brings me to my problem.
I have some classes that have Hashtables collections defined as class
variables.
In the past, when I was done with the class, I would remove all the items
from the collection and then set the collection to null.
In C# (.NET General), is this necessary anymore? For example, do I need to
implement a dispose method that would remove all the items from the
collection and set the collection to null. Is it enough to just set the
class instance to null and everything inside would be cleaned up?
Thanks in advance.
Greg
resources. I think that it was easier when you just cleaned up every object,
which brings me to my problem.
I have some classes that have Hashtables collections defined as class
variables.
In the past, when I was done with the class, I would remove all the items
from the collection and then set the collection to null.
In C# (.NET General), is this necessary anymore? For example, do I need to
implement a dispose method that would remove all the items from the
collection and set the collection to null. Is it enough to just set the
class instance to null and everything inside would be cleaned up?
Thanks in advance.
Greg