Anyone have any insight as to why my plugin object does not get disposed if the videoCtrl.IsStatic= false in the code snippet below? There should be no references to my plugin after the Foo method returns.
- Code: Select all
Private void Foo()
{
IVideoControl videoCtrl = this.VideoControlFromAssembly(type2, type, assembly);
this.AddToListAssemblyInfo(videoCtrl, info3.FullName, type, assembly.GetName().Version.ToString());
}
private void AddToListAssemblyInfo(IVideoControl videoCtrl, string pathToAssembly, Type oType, string version)
{
if (videoCtrl != null)
{
ListViewItem item = this.lvControls.Items.Add(oType.Name);
item.SubItems.Add(videoCtrl.IsStatic.ToString());
item.SubItems.Add(videoCtrl.VideoType);
string objectType = oType.Namespace + "." + oType.Name;
if (videoCtrl.IsStatic)
{
item.Tag = new ControlRecClass(pathToAssembly, objectType, videoCtrl);
}
else
{
item.Tag = new ControlRecClass(pathToAssembly, objectType, null);
}
this._logger.Log("Plugin found: " + objectType + ", Video type: " + videoCtrl.VideoType.ToUpperInvariant() + ", Version: " + version, Color.LightGreen);
}
}
The Instance graph looks like
http://dl.dropbox.com/u/1922033/InstanceGraph.jpg