Jump to content

GDI Object Leak


Recommended Posts

I have a program that is creating about 200 new GDI Objects an hour. After about 24hrs of execution the GDI Objects exceeds 5000 and LabVIEW crashes (Sorry for the inconvenience). I disabled all of my UI updates and it continues to leak. Are there non-UI actions that create new GDI objects?

Link to comment

I run the system as an executable and it has the same problem. I was hoping to find out what kind of LabVIEW functions create new GDI objects. This is probably something bad that my code is doing, but my system is large and it has been difficult to isolate the culprit.

Link to comment

LabVIEW creates a fixed set of GDI objects on start and then as needed when it draws something on the screen, and also offscreen when you work with Picture control or print something. In my work with LabVIEW I haven't really seen LabVIEW itself leaking GDI objects for quite a few years. However if you interface to external components such as ActiveX, .Net or DLL functions, that of course does not mean anything. They can create and not properly deallocate GDI objects as much as they like.

DETT only can look into LabVIEW resources itself, not into resources allocated by those external components. The way to go after this is to get an idea of the rate of GDI object increase and trying to relate that to certain operations in your application. Then starting to selectively disable code parts until the object count doesn't increase steadily anymore. From there concur and divide by disabling smaller and smaller parts of code until you get a pretty good idea about the location.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.