BUG: UserControl Containing Array of Controls Leaks Memory (190511)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q190511 SYMPTOMS
If a UserControl containing an array of controls is used, and one of the
elements of the control array is assigned to an object, the following error
may occur with repeated loading and unloading of the form that hosts the
UserControl:
"Error 7: Out of memory"
RESOLUTION
There are two possible resolutions to this issue:
- Create controls individually rather than in an control array.
- Create a Public method in the user control that releases allocated memory
and then call the method from the Form that hosts the control array
during the Form Unload event. Note that you cannot do this in the
control's Terminate event because this event does not fire in this
situation.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products
listed at the beginning of this article. We are researching this
bug and will post new information here in the Microsoft Knowledge
Base as it becomes available.
Modification Type: | Major | Last Reviewed: | 10/15/2002 |
---|
Keywords: | kbBug kbControl kbDSupport KB190511 |
---|
|