PRB: Object Instances Are Not Freed from Memory (129946)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q129946 SYMPTOMS
If you use class modules to build a linked list, Visual Basic will free the
memory it can when the variable containing the head of the list goes out of
scope. However if you build a circular list (a list in which an object
references itself) and attempt to destroy all references to the circular
reference, Visual Basic will retain the instances of the objects in memory
while the program is running because the references to the objects actually
still exist. As a result, memory is lost until the OLE Server's Terminate
event is called, which is when the last instance of the class is freed.
CAUSE
Under any of the following conditions, the Visual Basic internal terminate
event is not called, so the object instances are not freed from memory: - Building a circular linked list.
- Executing an End statement.
- Choosing Restart from the Run menu.
- Clicking the End button on an Error dialog.
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 12/9/2003 |
---|
Keywords: | kbprb KB129946 |
---|
|