Public ox, oy, oz ox = Create("Form") oz = ox ox.AddObject("Text1","Textbox") ox.Show oy = ox.Text1If you try to release the form, it stays on the screen. OX is already .NULL., the same is valid for oz, because the Release() method can by default nullify all references to the object itself. This won't work, of course, for object that don't have a Release method, nor does the same reliable happen if you release an object by letting it go out of scope. But because of the reference oy to one of it's members, the form is still there, that's what we call a dangling reference.
Public ox, oy, oz ox = Create("myForm") oz = ox ox.AddObject("Text1","Textbox") ox.Show oy = ox.Text1 Define Class myForm as Form Procedure Release Release This EndProc Procedure Destroy This.RemoveObject("Text1") Endproc EnddefineThe form closes without any problems. RELEASE THIS is here not necessary, but it's for example in a label class. The point here is RemoveObject() which removes the textbox even when there's a reference pointing to it. oy is .NULL. after the RemoveObject() line has been executed. The default behavior of Destroy() is to finally release the object, and when VFP tries to do this, there's no object on the form anymore. Thus, it can't find any dangling references and releases the form just fine.