Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cleaning up object references
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Cleaning up object references
Miscellaneous
Thread ID:
00167010
Message ID:
00167010
Views:
64
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,
-Paul

RCS Solutions, Inc.
Blog
Twitter
Next
Reply
Map
View

Click here to load this message in the networking platform