V
Viorel Ghilas
Hi all
I have a list of Componet objects and put them in Containner, after
container is disposed then components doesn't disposed
I write some code example
Component c = new Component();
using(Container list = new Container()) {
list.Add(c, "c");
ISite site = c.Site;
...
}
but after this code c is not null
but in Container dispose method look like this
protected virtual void Dispose(bool disposing)
{
ISite site1;
int num1;
if (!disposing)
{
return;
}
Container container1 = this;
lock (container1)
{
while ((this.siteCount > 0))
{
num1 = (this.siteCount - 1);
this.siteCount = num1;
site1 = this.sites[num1];
site1.Component.Site = null;
site1.Component.Dispose();
}
this.sites = null;
}
}why c is not null, if container dispose themwith best regardsViorel Ghilas
I have a list of Componet objects and put them in Containner, after
container is disposed then components doesn't disposed
I write some code example
Component c = new Component();
using(Container list = new Container()) {
list.Add(c, "c");
ISite site = c.Site;
...
}
but after this code c is not null
but in Container dispose method look like this
protected virtual void Dispose(bool disposing)
{
ISite site1;
int num1;
if (!disposing)
{
return;
}
Container container1 = this;
lock (container1)
{
while ((this.siteCount > 0))
{
num1 = (this.siteCount - 1);
this.siteCount = num1;
site1 = this.sites[num1];
site1.Component.Site = null;
site1.Component.Dispose();
}
this.sites = null;
}
}why c is not null, if container dispose themwith best regardsViorel Ghilas