Bug Found? Tooltip memory leak

G

Guest

I recently found that one of my application was leaking memory every time I closed a MDIChild form. The garbage collector never reclaimed it and my windows handles kept increasing and increasing until eventually the application crashed

After three days of looking through all of my code I found that it was the TOOLTIP component that was causing the problem

The overcome the problem I had to add the following to the CLOSING procedure in the for

tooltip1.removeal
tooltip1.dispos

The problem then went away

Out of interest I created a new application to see what happened
With the tooltip added it leaked memory (unless I did a tooltip.removeall/dispose). Without the tooltip it worked fine
Tried this in both VB 2002 and VB 2003 and both did the same

Just thought it worth posting something here in case anyone else is having the same problem as I wasted two whole days trying to find this problem and hopefully can save other people some time

Microsoft... I think this component needs looking at

Kind Regard
Simo
 
C

Charles Law

Hi Simon

As you have spent time with the tooltip control, I wonder if you have had
any other problems? I have not experienced the leak - although it looks like
I will sooner or later - but I have found that when I attach a tooltip to a
checkbox, for example, the tooltip disappears every time I click the
checkbox, and never comes back.

I am having to reset the tooltip in the click event at the moment, but I
don't like it.

I have also read that there is a problem when hiding and re-showing, or
minimising and restoring a window with tooltips. The suggestion is that the
same thing happens, i.e. the tooltips disappear.

Have you seen any of these happen, or do you have any other special
techniques for dealing with tooltips?

TIA

Charles


Simon Richardson said:
I recently found that one of my application was leaking memory every time
I closed a MDIChild form. The garbage collector never reclaimed it and my
windows handles kept increasing and increasing until eventually the
application crashed.
After three days of looking through all of my code I found that it was the
TOOLTIP component that was causing the problem.
The overcome the problem I had to add the following to the CLOSING procedure in the form

tooltip1.removeall
tooltip1.dispose

The problem then went away.

Out of interest I created a new application to see what happened.
With the tooltip added it leaked memory (unless I did a
tooltip.removeall/dispose). Without the tooltip it worked fine.
Tried this in both VB 2002 and VB 2003 and both did the same.

Just thought it worth posting something here in case anyone else is having
the same problem as I wasted two whole days trying to find this problem and
hopefully can save other people some time.
 
G

Guest

What I do with Tooltips is very basic. I add it as a control on my form and then type text into each field
When looking at my applications which use tooltips I seem to have problems of various kinds in them all

By deleting the tooltip control, problems go away

Must admit that the tooltip isn't very functional either.. would be nice to have bubble tips etc

Maybe if we ask nicely we will get a more functional, less buggy control

Anyone else any comments on this
Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top