![]()
|
Top: Basic types: variant: Object references
It should be noted that the reference counting mechanism has a potential flaw which may lead to memory leaks. Consider two objects containing variants with cross-referencing pointers to each other. The library can not keep track of such circular references, and an attempt to free one of the objects will result in destroying only one of them and leaving the other in the memory without any references to it. This is a known problem and can be solved by either eliminating circular references when designing data structures or by providing a complex memory 'garbage collector' which keeps track of all object references in the program. See also: unknown & component, Assignments and typecasts, Arrays, Utilities PTypes home |