DG Kernel (ActiveX) Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
What is new
Upgrading Native Apps
Licensing
Collapse ModelsModels
Collapse DG Kernel ControlsDG Kernel Controls
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Collapse General GeometryGeneral Geometry
Collapse ModelModel
Collapse ViewView
Collapse General ComputingGeneral Computing
Collapse ViewsViews
Collapse Samples and TutorialsSamples and Tutorials
Collapse GraphicsGraphics
Collapse Math ObjectsMath Objects
Collapse DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation Links Go to DGKC docs Search Documentation


Memory management

All objects, which expose interfaces, maintain internally an integer value called reference count. The reference count is incremented when an interface has been queried from the object or another object inside the software stores a reference to it. The reference count is decremented when an interface or reference is released. A reference-counted object is only deleted from memory during a release operation when its reference count becomes zero

In most situation the reference counting is maintained internally by DG Kernel and should not be modified. Sometimes, often when normal flow of execution was interrupted by an exception, the reference count can become incorrect and the object can be over-released and prematurely deleted, which often causes an exception.

On the other hand, reference count being incorrectly greater than the actual number of users, causes a memory leak. In either situation please report the problem

The reference counting can be checked using IGlobalAPI_KC.GetRefernceCount() method.