Microsoft KB Archive/299918

= FIX: Memory Leak Calling Connection Designer from Database Designer =

Article ID: 299918

Article Last Modified on 10/16/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q299918



SYMPTOMS
A memory leak occurs in Visual FoxPro (VFP) versions 5.0 and 6.0 when you open the Connection designer from the Database designer.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

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



Steps to Reproduce Behavior
  In VFP 5.0 or 6.0, paste the following code in a new program: *!* Q299918 FIX: Memory Leak Calling Connection Designer from Database Designer LOCAL lni
 * 1) DEFINE DBCNAME &quot;Q299918&quot;

CD SUBSTR(SYS(16),1, ATC(&quot;\&quot;,SYS(16),OCCURS(&quot;\&quot;,SYS(16)))) CLEAR CLOSE DATABASES ALL ERASE Q299918.*
 * !* CD to the DIR containing this .PRG
 * !* Clean-up old database

CREATE DATABASE DBCNAME CREATE CONNECTION Connection1 CONNSTRING &quot;TEST&quot;

FOR lni = 1 TO 10 KEYBOARD '{alt+d}o{enter}{enter}{alt+f4}{ctrl+w}' MODIFY DATABASE && Store counter here because it will survive CLEAR ALL _CALCMEM = lni CLEAR ALL ? &quot;Memory Handles Used:&quot;, SYS(1011), &quot;User Object Memory Use:&quot;, SYS(1016) LOCAL lni lni = _CALCMEM ENDFOR CLOSE DATABASES ALL  Save and run the code (the name is unimportant).

When run, the code creates a database and a connection. It then opens and closes the Connection designer 10 times from the Database designer. After the code finishes, the current values of SYS(1011) (number of memory handles) and of SYS(1016) (user object memory use) are printed to _SCREEN. Note that in VFP 5.0 and 6.0, there is a leak of approximately 2 handles and 400 bytes of memory per iteration.

Keywords: kbbug kbfix kbcodesnippet kbbuilder kbvfp700fix KB299918

-

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

© Microsoft Corporation. All rights reserved.