Paul,
One approach would be to create a cleanup method in your main object.
This would be called by your exit routine, which in turn is typically called by ON SHUTDOWN -- that way no matter has the app is closed, the cleanup method gets invoked.
The cleanup method would release or destroy the two subordinate objects (make certain the the destroy event of the subordinate object all reference to the main object are destroyed by setting them to .NULL.), then restore the VFP environment, then destroy the main object, then quit.
Generally containers destroy all contained objects when the container is destroyed -- i.e. all objects on a form are destroyed when the form is destroyed. But non-container objects (which is sounds like you are using) require more deliberate coding.
good luck,
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.comNo trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.