Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Observer Pattern: Dangling References
Message
De
03/04/2000 17:18:50
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00354611
Message ID:
00354618
Vues:
15
I found the only way was to iterate through the array property (in the form destroy), setting each element to .NULL. It didn't work to set the array property, itself, to .NULL.

>I'm working on an observer pattern utilizing a listbox as the subject, and custom classes (textbox & label) as observers. I'm using the following Attach method in the listbox:
>
lparameter oObserver
>
>if type('This.aObservers(1)') # 'O'
>	x = 1
>else
>	x = alen(this.aObservers) + 1
>endif
>
>dime this.aObservers(x)
>this.aObservers(x) = oObserver
>oObserver = .null.
>
>I can not seem to get rid of these references. When and where should I be clearing them? I've been trying to do it in the destroy event to no avail. I must be missing something...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform