Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application stays in memory after shut down

Status
Not open for further replies.

knovo

Programmer
May 7, 2001
6
US
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.

Thanks
 
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
 
Also, check for a Do: DoEvents: Loop somewhere...especially in an OCX or DLL module.

Just thought I'd interject,
-iNSTA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top