I have a class that encapsulates a Container, say Set, and I want the method getSet to return a *copy* of the data member (so as to preserving the privacy of access to the data member).
However, this method is accessed many times by the GUI interface, almost on every user driven event. What I want to know is this:
For the temporary objects returned (to display the collection but not allow direct modification) does invoking dispose() on these temporary objects support garbage collection or not?
Obviously I don't want to dispose of the objects within the collection, only to preserve its integrety within the class.
However, this method is accessed many times by the GUI interface, almost on every user driven event. What I want to know is this:
For the temporary objects returned (to display the collection but not allow direct modification) does invoking dispose() on these temporary objects support garbage collection or not?
Obviously I don't want to dispose of the objects within the collection, only to preserve its integrety within the class.