Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating Object skips Thisform.Release()
Message
From
11/06/2003 19:23:00
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00798705
Message ID:
00799182
Views:
54
David,
Ok, now I think I see where I was confused.

Just to make sure I got it right:

The form is being destroyed and as a consequence of that the Form.Destroy() is executing.
But in reality the form hasn't really finished being destroyed, so none of the controls are destroyed, and none of the control Destroy()s are ever executed.

Ok, one last thing.
Do you see a difference between these two concepts, that would make one work but the other doesn't?
Why isn't the first example (used in ALL the _base.vcx classes) a deadly embrace also?
this works
form.control.method()
  this.oHost = thisform
endproc
form.control.destroy()
  this.oHost = .null.
endproc
this doesn't
form.control.method()
  lo = newobject('anything')
  lo.oCreator = this
  this.addproperty('oSomething',lo)
endproc
form.control.destroy()
  this.oSomething = .null.
endproc

anything.destroy()
  this.oCreator = .null.
endproc
>Bill,
>
>Because of your deadly embrace situation you are going to have to explicitly call a cleanup method of one of those two objects so that the references can be removed.
>
>You can put the clean up in the Destroy(), but realize that calling Destroy doesn't really cause the object to be destroyed. Destroy is an event that fires as the object is destructing.
>
>>No Control.Destroy() method is ever STARTED. The Form.Destroy() executes, releasing the variable it's linked to, but NO CONTROL Destroy() ever starts. There is code in EVERY Control.Destroy() method on the form, but none of them ever get started.
Bill Morris
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform