Re: Preventing an application from staying in memory if closed improperly
- From: "Bob Butler" <noway@xxxxxxxxxxx>
- Date: Thu, 24 May 2007 12:41:01 -0700
"Scott M." <quanker@xxxxxxxxx> wrote in message news:1180031232.721684.137500@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I need some general advice on how to prevent my VB6 application from
remaining in memory after it has supposedly shut down.
VB apps end when all forms are unloaded and no code is running. Usually what you describe indicates that a form is still there. If it does this in the IDE it's often easy to debug by pausing the app and checking the Forms collection and using F8 to single-step any code still running.
If it doesn't happen in the IDE then you may need to add some code to the form_terminate event to log any entries in the Forms collection or check to see if there is any way a loop could still be processing.
Your Form_Unload event should make sure all forms are unloaded, all timers stopped, all external references (e.g. Word, Excel, other ActiveX objects) are released, and all files/databases/etc are closed.
Do NOT fall back to using END; that's a band-aid that can do more harm than good.
.
- Follow-Ups:
- References:
- Prev by Date: Re: Which Windows Registry Key is BEST for my work
- Next by Date: Re: Which Windows Registry Key is BEST for my work
- Previous by thread: Preventing an application from staying in memory if closed improperly
- Next by thread: Re: Preventing an application from staying in memory if closed improperly
- Index(es):
Relevant Pages
|