473,387 Members | 1,481 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Dispose and InitializeComponent

Theoretically, are there ever any cases or known defects where you should
have to do any of the following to objects created by the designer inside of
InitializeComponent()?

1 - call dispose() on an object
2 - set to null an object
3 - Manually tear down an event

I'm having a dickens of a time tracking down a memory bleed. I can reduce
the severity of the bleed by adding the above statements into the Dispose()
functions. I'm sure that by doing this I'm making sections of the graphed
memory unreachable so the GC reclaims it - just haven't figured out what
connection to the whole isn't getting severed yet.

I'm using the SciTech .NET memory profiler so I know the bleed is real.
Unfortunatlely it isn't following the reference links back to something
useful - they go back to Object [] which goes back to root

Thanks.
Sep 27 '07 #1
1 2176

"Dave Harris" <Da********@discussions.microsoft.comha scritto nel
messaggio news:D3**********************************@microsof t.com...
Theoretically, are there ever any cases or known defects where you should
have to do any of the following to objects created by the designer inside
of
InitializeComponent()?

1 - call dispose() on an object
2 - set to null an object
3 - Manually tear down an event
None as far as I know.
I'm having a dickens of a time tracking down a memory bleed. I can reduce
the severity of the bleed by adding the above statements into the
Dispose()
functions. I'm sure that by doing this I'm making sections of the graphed
memory unreachable so the GC reclaims it - just haven't figured out what
connection to the whole isn't getting severed yet.

I'm using the SciTech .NET memory profiler so I know the bleed is real.
Unfortunatlely it isn't following the reference links back to something
useful - they go back to Object [] which goes back to root

Thanks.
Track'em down with windbg. It's harder but more "fun".
Here's a how to: http://blogs.msdn.com/ricom/archive/...10/279612.aspx

Sep 27 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: edster | last post by:
A *lot* of our teams code is being deleted from the InitializeComponent() section of a winform, such as Grid settings, event handler hooks, layout settings etc. This mainly seems to happen to 3rd...
3
by: Scott Kilbourn | last post by:
Hi, I added some custom code to the InitalizeComponent function of a control that I'm working on. Every once in a while, I've noticed that the code that I added disappears. I finally tracked...
9
by: Charles Law | last post by:
I have a form on which user controls are placed at runtime. When a control is added to the form a handler is added for an event that a high-level object raises, which must be handled by the new...
0
by: Deepak C.G via .NET 247 | last post by:
I want to dispose the image object in my child form, unless I won't dispose this object i can't delete the image file in my folder. I get this error in MDIparent form "An unhandled exception...
5
by: Michael Sander | last post by:
Hi, I found out, that a simple Form, created only with the designer, wont Dispose its contextmenu if you show the form, right-click it, and dispose the form afterwards. This isnt really what I...
2
by: eBob.com | last post by:
I have a user control which creates an Excel spread sheet and badly needs Dispose/Finalize. I've read up on the subject in Balena and I think I understand what is going on. But the VS generated...
4
by: SteveT | last post by:
I have written a control that does some base functionality. I then wrote a control that inherits from it so that I can make several unique versions which behave differently. To do this the...
4
by: Rob Panosh | last post by:
Hello, If I create a font on my inherited form (sample code below) do I have to "Dispose" this font. Thanks, Rob Class MyTest Inherits System.Windows.Forms.Form
19
by: rbrowning1958 | last post by:
Hello, I am confused by dispose etc. and hope someone can set me right. 1. The Dispose(Bool) the IDE generates for a form has nothing to do with IDisposable, right? 2. So when is this called?...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.