Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Observer Pattern: Dangling References
Message
From
03/04/2000 17:18:50
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00354611
Message ID:
00354618
Views:
21
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...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform