Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing object from form to form
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01501305
Message ID:
01501316
Views:
45
>>>Hi,
>>>
>>>I have a Form 1 that has a couple of BIZ objects referenced in the Form 1 properties (e.g. thisform.my_biz_obj)
>>>
>>>In a click method of a button (on Form 1) Form 2 is instantiated and the BIZ object references are passed to Form 2. In the INIT of Form 2 the BIZ objects are assigned to properties of Form 2 (e.g. the same name as in Form 1, thisform.my_biz_obj).
>>>
>>>My question is, when Form 2 is released should I destroy the references of the BIZ objects? My concern is that if I set the property thisform.my_biz_obj of Form 2 to NULL it will destroy the BIZ object for Form 1 (which is not what I want). By the same token I don't want to end up with dangling references.
>>>
>>>TIA for your help.
>>
>>No, it will not destroy the objects. You do need to add this code in the Destroy method.
>>BTW, it should be very easy to test.
>
>Thank you. So you are saying that the Child form (form 2) should set the property to NULL in the Destroy method, right?

Yes, exactly.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform