Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Thisform.release
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00040029
Message ID:
00040076
Views:
34
> I understand that. But what would prevent normal form release? The procedure is quite simple. It's basicaly a 'holdable button' that uses a timer to repeat a task as long a the button is held down. It doesn't matter what the task is, because I've commented out the code, so I know the problem must be in the holddown code somewhere. However, I've used the holdable class in other places and never had any problems. Quite strange.

Mike,

What can prevent the fomr from releasing is any external object reference to the fomr or anyone of its controls. For example if the timer has a property that references the Button (or vice versa) and you try to relase the fomr, the form in trun tries to release all of the controls. However when it tries to release the button it cannot because the timer has a reference to that button, so the button release fails and in turn the form release fails.

If you are holding object references like this you are responsibile for cleaning them up. One way to do this is to recurse through all of the controls in the form iside the form's release and call a cleanup method (that you created for teh contrl) that will .NULL. any object reference properties before the normal action of the form's release tries to blow the controls away.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform