Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating Object skips Thisform.Release()
Message
 
 
À
10/06/2003 21:24:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00798705
Message ID:
00798720
Vues:
35
Bill,

Did you look at the article on my website that Sergey pointed you to?

You have a dangling object reference. The form can't destruct because the button can't destruct because the hyperlink has an object reference to the button which has an object ref to the hyperlink.

You are going to have to explicitly code to handle this interlinked relationship in both the button.Destroy:

if ( type( "this.oHyperlink" ) == "O" )
this.oHyperlink.oCreator = .null.
this.oHyperlink = .null.
endif

And to be safe in the Hyperlink.Destroy:

if ( type( "this.oCreator" ) == "O" )
this.oCreator.oHyperLink = .null.
this.oCreator = .null.
endif

Of course this code is bad from the context that both classes are requiring intimate knowledge of the other class. I'm not sure why you'd want the hyperlink know what created it.

>I just discovered that even though the Form.Release() doesn't execute, the form object no longer exists.
>ie: Do form myForm, creates an object myForm
>after the Form.Release() is issued myForm is .null., even though the form is still on my screen.
>I presume that's an indication that there's a dangling object somewhere. But how do I get a destroy method to destroy it if no destroy()s ever run.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform