Microsoft KB Archive/299836

= FIX: Destroy Does Not Fire for LOCAL and PRIVATE Objects When QUIT Is Called =

Article ID: 299836

Article Last Modified on 10/15/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q299836



SYMPTOMS
If you use a local variable for an object, the Destroy event is not called when you quit Visual FoxPro before releasing the object.



STATUS
This problem was corrected in Visual FoxPro version 7.0 for Windows.



Steps to Reproduce Behavior
  Save the following code as a program: *!* Q299836 FIX: Destroy Doesn't Fire For LOCAL And PRIVATE Objects When QUIT Is Called

LOCAL ox

ox = CreateObject(&quot;TestClass&quot;) QUIT

DEFINE CLASS TestClass AS Label PROCEDURE Destroy WAIT WINDOW &quot;Destroy Event&quot; ENDPROC ENDDEFINE  Run the program. Note that Visual FoxPro exits without the WAIT WINDOW appearing.  Replace the following line LOCAL ox with: PUBLIC ox.  Run the program again. Note that you see a WAIT WINDOW before Visual FoxPro exits.

Keywords: kbbug kbfix kboop kbcodesnippet kbvfp700fix KB299836

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.