FIX: Memory Not Released in BROWSE with ON ERROR

ID: Q113671

2.50x 2.6x | 2.5x 2.6x

WINDOWS    | MS-DOS

The information in this article applies to:

SYMPTOMS

Memory is not being released when a BROWSE command is combined in a program with an ON ERROR routine in effect. This behavior often results in the error message "Insufficient Memory" or a Win32S error if you are using Visual FoxPro under Windows or Windows for Workgroups.

WORKAROUND

To workaround this situation, remove the ON ERROR routine from the code.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual FoxPro 3.0 for Windows.

MORE INFORMATION

The following code reproduces the problem:

   ON ERROR ? MESSAGE()
   USE customer    && From the Tutorial directory
   DO WHILE .T.
     BROWSE FIELDS x=company, y=contact, z=ytdpurch FREEZE state NOWAIT
     ? SYS(1011)
   ENDDO

When run in the Standard (16-bit) version of FoxPro for MS-DOS, the above routine will result in an "Insufficient Memory" error message after executing approximately 10 times. In the Extended (32-bit) version, the routine executes but continues to register more and more memory handles used. In FoxPro version 2.6 for Windows, the same thing happens, but after a minute or so, a general protection (GP) fault occurs. In FoxPro version 2.5x for Windows, a "Not Enough Memory for Buffer" error message may occur instead. Both of these errors will force FoxPro to close.

Additional reference words: FoxDos FoxWin VFoxWin 2.50 2.50a 2.50b 2.60 fixlist3.00 buglist2.50 buglist2.50a buglist2.50b buglist2.60 errmsg err msg gpf KBCategory: KBSubcategory: FxprgBrowse

Keywords          : kberrmsg FxprgBrowse 
Version           : 2.50x 2.6x | 2.5x 2.6x
Platform          : MS-DOS WINDOWS
Solution Type     : kbfix

Last Reviewed: May 22, 1998