FIX: Destroy() Does Not Fire for LOCAL and PRIVATE Objects When QUIT Is Called (299836)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 6.0

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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. 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("TestClass")
    QUIT
    
    DEFINE CLASS TestClass AS Label
     PROCEDURE Destroy
      WAIT WINDOW "Destroy Event"
     ENDPROC
    ENDDEFINE
    					
  2. Run the program. Note that Visual FoxPro exits without the WAIT WINDOW appearing.
  3. Replace the following line
    LOCAL ox
    					
    with:
    PUBLIC ox.
    					
  4. Run the program again. Note that you see a WAIT WINDOW before Visual FoxPro exits.

Modification Type:MajorLast Reviewed:10/15/2002
Keywords:kbBug kbCodeSnippet kbOOP kbvfp700fix KB299836