Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
150
(UltraToolTipInfo dispose
posted

Dear All,

I have a question about the UltraToolTipInfo dispose. If I used the following codes, sometimes I will get application crash.

using(UltraToolTipInfo toolTipInfo = new UltraToolTipInfo("Enter some text here.", ToolTipImage.Info, "This is textBox1", DefaultableBoolean.True))

{

this.ultraToolTipManager1.SetUltraToolTip(this.textBox1, toolTipInfo);
}

The object was disposed at the end of the using but depending on when the Garbage Collector actually deleted the memory, a random crash would occur when trying to access this tooltip object again when attempting to display the tooltip. I searched that the dispose method is empty. So I am not very sure it's the right way to use this.

Right now I use the Coverity to statically analyze the codes. If toolTipInfo is not disposed, there will be a message that "Resource leak (RESOURCE_LEAK)Returning without disposing "tipInfo"". That's why I want to do it like this.

From your help website, it does not use "using" to wrap it. I wanna know

1. if i do not dispose toolTipInfo and ultraToolTipManager1, is there any risk of memory leak?

2. Do I have to declare a UltraToolTipInfo variable for whole class and dispose it in the Class's dispose method?

3. Do I have to dispose ultraToolTipManager1?

4. Is there any way to solve the problem from Coverity?
http://help.infragistics.com/Help/Doc/WinForms/2012.2/CLR4.0/html/Infragistics4.Win.v12.2~Infragistics.Win.UltraWinToolTip.UltraToolTipInfo.html

Thank you very much.

Thanks & Regards,

Li