I have an app written in VB which is suddenly staying in memory after application shut down. Is there some tool I can use to determine what is not being closed down properly? The debugger is not really useful.
You've most likely made a reference to some object - perhaps a form - and that object or form is not being unloaded, thus preventing the application from completly shutting down.
You can place the following code in the Form_Unload event of the main form
Code:
Dim lFrm_Form As Form
For Each lFrm_Form In Forms
Unload lFrm_Form
Set lFrm_Form = Nothing
Next lFrm_Form
and that may allow the program to terminate, but it doesn't necessarily help you find the reference that may be causing the problem in the first place.
An example of such type of reference could be something like the following, when this line is executed from the main form:
frmForm2.txtTextBox = "A Value"
This will cause frmForm2 to be loaded, and unless it gets unloaded, the app will not end.
Its also possible that it could some other type of object that is instantiated, but never released. Good Luck
-------------- As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.