I'm starting to write more apps. using objects instead of functions/procedures. In a current app, almost everything is an object, and there isn't a user interface (except for a diagnostic screen that can be turned on/off in the configuration program). As I'm writing this, I'm starting to realize I don't understand where/how to release all of my objects to clean up things. Here's how the program currently works:
main.prg - creates main object
mainobj - creates two different objects it uses for processing. If the debug mode is on, it also creates a dianostic screen where messages appear as things are processed. All the objects maintain references to the other objects, for example:
In my MainObj:
THIS.oSecond = CreateObject("SecondObj")
THIS.oSecond.oMainObj = THIS
I'm trying to do two different things. If the diagnostic screen is running, if I close it I want all the other objects/programs to quit. I'm also thinking about file-based messaging to be able to close this app if the diagnostic screen isn't running. Right now, I've tried a bunch of combinations of things to release these objects, but I'm fairly sure they aren't working (since after "closing" the app, I can't edit it in VFP because VFP says it's in use).
Thanks,