Microsoft Knowledge Base Email Alertz

(817795) - Fixes a problem where the ToolTip component causes a memory leak when it is located on a child MDI form.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 817795 - Last Review: September 27, 2005 - Revision: 2.7

FIX: The ToolTip component may cause a memory leak when it is added to a child MDI form in Visual Studio .NET

SYMPTOMS

When you work with ToolTip components in Microsoft Visual Studio .NET with Windows Forms in multiple-document interface (MDI) mode, your application may experience a memory leak every time that the ToolTip components are used on the child MDI form. You may notice this problem as an increase in the Graphics Device Interface (GDI) Object count that Microsoft Windows Task Manager displays as the operation repeats.

To view the GDI Object count in Task Manager, follow these steps:
  1. Open the Task Manager window.
  2. On the View menu, click Select Columns.
  3. In the Select Columns dialog box, click to select GDI Objects.

CAUSE

This problem occurs when you have a ToolTip component embedded on a child MDI form, and the child MDI form is destroyed. The ToolTip component is not garbage collected after the MDI form is destroyed.

RESOLUTION

To resolve this problem, obtain the latest service pack for Microsoft .NET Framework 1.0 or Microsoft .NET Framework 1.1. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
867461  (http://kbalertz.com/Feedback.aspx?kbNumber=867461/ ) .

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

WORKAROUND

For MDI forms that have ToolTip components, add the following code to the MDI form to destroy all ToolTip components, when the form is destroyed:
protected override void Dispose(bool disposing) 
{ 
If (disposing) 
{ 
If (components != null) 
{ 
components.Dispose(); components = null; 
} 
If (toolTip1 != null) 
{ 
// Code to add 
toolTip1.Dispose(); 
// toolTip1 = null; 
// }
// }
base.Dipose(disposing); 
} 

REFERENCES

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
824684  (http://kbalertz.com/Feedback.aspx?kbNumber=824684/ ) Description of the standard terminology that is used to describe Microsoft software updates

APPLIES TO
  • Microsoft .NET Framework 1.0
  • Microsoft .NET Framework 1.1
  • Microsoft Visual Studio .NET 2003 Enterprise Architect
  • Microsoft Visual Studio .NET 2003 Enterprise Developer
  • Microsoft Visual Studio .NET 2003 Academic Edition
  • Microsoft Visual Studio .NET 2002 Enterprise Architect
  • Microsoft Visual Studio .NET 2002 Enterprise Developer
  • Microsoft Visual Studio .NET 2002 Professional Edition
  • Microsoft Visual Studio .NET 2002 Academic Edition
Keywords: 
kbhotfixserver kbqfe kbvs2002sp1sweep kbqfe kbfix kbbug KB817795
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate