I've been investigating runtime memory profiles in our app, and found an issue which appears come from an Actipro type.
The class `MicroBulletGraph` has a static field of type `MicroChartsLicenseToken`. In the instance constructor of this type, the profiler indicates code similar to the following exists and is run:
if (StaticLicenseTokenField == null)
{
StaticLicenseTokenField = new MicroChartsLicenseToken(this);
}
The problem is the "this" pointer. This roots the instance in a static field and when the control is created and wired up to our viewmodels, eventually a large graph of objects stays rooted from this token referencing the first created `MicroBulletGraph`. We could take pains to sever our links to the control, but it seems that the one instance will stay rooted. I looked to see if any other Actipro control behaves this way, and among the Ribbon and Docking controls I don't see this pattern of a static token instance referencing a control instance.
How can we keep from leaking unused, reachable objects through this `MicroBulletGraph` static field reference?