470,855 Members | 1,251 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,855 developers. It's quick & easy.

Re: memory managment

Fred wrote:

When a control is disposed, should it first set its Tag property (if
present) to null ?

I use a commercial control and I saw (with a .NET memory profiler) that
the objects I put in this property were not collected even when the
control is disposed (until I set the tag
property to null)
If you hang on to the control a long time after it has been disposed,
you can set the Tag property to null to make thae object that it
references collectable.

Otherwise there is rarely any reason to setting references to null. When
the control gets collectable, any objects that it references (and isn't
references from somewhere else) also automatically gets collectable.

Göran Andersson
Jun 27 '08 #1
0 581

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Yves Dhondt | last post: by
2 posts views Thread by Matthias Kwiedor | last post: by
7 posts views Thread by Casey Leamon | last post: by
1 post views Thread by Ashish | last post: by
18 posts views Thread by CJ Taylor | last post: by
13 posts views Thread by Nikolay Petrov | last post: by
1 post views Thread by bsimon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.