BUG: Memory Leak Using UBound or LBound When Returning Array (197190)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q197190 SYMPTOMS
When you use a function that returns an array as a parameter to the UBound
or LBound functions, the memory allocated for the array is not released.
CAUSE
The array is copied to temporary return storage, but the temporary storage
is not released until the application ends.
RESOLUTION
To avoid this problem, assign the return value to a local variable before
using UBound or LBound. For example:
vntReturn = ArryFunc()
iAryLen = UBound(vntReturn)
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 5/13/2003 |
---|
Keywords: | kbBug kbpending KB197190 |
---|
|