Juan,
I have to admit, I've never used the TreeView control in an app or even played with it for fun. So I'm not exactly sure where to tell you to look. In your form.Destroy() does it help to simply RemoveObject( "TheTreeView" )? Does the TreeView have a Release() method you can call. You are sure that you don't have a line like:
thisform.oTree = thisform.TheTreeView
This is the kind of thing that prevents an object from releasing.
CLEAR ALL is just kind of a way to get you past this problem, you can't put it in your app.
>CLEAR ALL works in the command window, it remove the form peacefully. But it does not work in destroy event of the form. The message given is "object still in use", something like that.
>
>I'd narrow down the search by adding a few lines of code in the destroy method of the form. These are the codes to remove all objects manually, using THISFORM.REMOVEOBJECT("myObject"), until the last object in the form. I notice the code failed when it tried to remove the TreeView object. I have no idea what holds up the object, preventing it from destroying. I check the code carefully and cannot find any pending reference to this object. Is there any other way to get rid of these "unknown" reference to objects???