Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filter clear
Message
From
18/10/2004 05:09:30
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
16/10/2004 18:13:19
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00951906
Message ID:
00952212
Views:
12
>Sorry, Mike... try this one:
LOCAL loObject
>loObject = CREATEOBJECT("Custom")
>AddProperty(m.loObject,"icName")
>m.loObject.icName = "Jim Nelson"
>
>CREATE CURSOR c_SomeCursor (cField1 c(10))
>INSERT INTO c_SomeCursor (cField1) VALUES ("Jim Nelson")
>INSERT INTO c_SomeCursor (cField1) VALUES ("Mike Yearwood")
>
>xx = m.loObject
>SET FILTER TO cField1 = m.xx.icName
>BROWSE
>
>RELEASE m.loObject
>
>CLEAR
>DISPLAY MEMORY LIKE loObject
>WAIT WINDOW "Hold down the shift key to see that the object is really gone."
>
>*Do a record movement and it will crash.
>GO TOP
>BROWSE
>
>Is it still proper to you, considering that loObject has been released?
>

As I started out saying in this thread, don't use object.property references in filters, so you'd not get this problem either. However, I believe that releasing the original variable should release all other references.

Suppose I have a wire connected to a light switch object. If I were a magician, when I release the object, it would vanish. If I connect a second wire, to the light switch as you did with your xx variable, when I release the light switch, it should vanish regardless or how many wires I connect to it.

That is what would happen with a physical object. That is what should happen with virtual objects too.
Previous
Reply
Map
View

Click here to load this message in the networking platform