Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Destroy event does not fire when form is released
Message
From
20/11/2001 14:53:04
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00582372
Message ID:
00584146
Views:
42
As I wrotem, my form releases well without this statement (VFP 7).
If the form is released, its poperties are released automatically.
It there are no references to object, this object must destroyed automatically
by VFP.
Is'nt it so?

>This really is not a bug. This is a dangling object reference. This is the real problem why the form will not destroy. You can optionally put the THIS.oComm = .null. in the Destroy, and your form should release.
>
>>Is this VFP bug ?
>>I think that when form is closed, all objected referenced only from
>>from properties are released automatically!
>>
>>>The form isn't being destroyed because of the oComm property needs to be released manually.
>>>
>>>Use the QueryUnload method of the form. This method is called when you click on the upper right corner button.
>>>
>>>
>>>PROCEDURE QueryUnload
>>>THIS.oComm = .null.
>>>ENDPROC
>>>
>>>
>>>>I create a comm object and event handler in form init()
>>>>
>>>>When the form is closed by clicking upper right corner, event handler Destroy()
>>>>event does not fire. Why ?
>>>>
>>>>
>>>>* Form Init()
>>>>this.oComm = createobject( "mscommlib.MSComm" )
>>>>EVENTHANDLER( this.oComm, NEWOBJECT("commevents", 'pump.prg' ) )
>>>>
>>>>
>>>>
>>>>* File pump.prg contains:
>>>>
>>>>DEFINE CLASS commevents AS custom
>>>>IMPLEMENTS DMSCommEvents IN "mscommlib.MSComm"
>>>>
>>>>procedure Destroy
>>>>* this event does not fire when form is closed. why ?
>>>>ENDPROC
>>>>
>>>>PROCEDURE DMSCommEvents_OnComm() AS VOID;
>>>>HELPSTRING "Occurs whenever the value of the CommEvent property changes."
>>>>ENDPROC
>>>>ENDDEFINE
>>>>
Andrus
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform