S
Scott Underhill
Hi All,
This might be something really straight fowward, but I have been debugging
my application.
I noticed some really unusual memory behaviour, after putting it through a
profile, I narrow
it down to the property AllowDrop = true.
I created some sample code, which simply adds a panel to a tab control 10
times, then removes
the control 10 times. If I have AllowDrop=true set the panel is never
destoryed in memory.
I am just interested in knowing why AllowDrop=true would stop the panel from
being destroyed ?
Thanks
Scott
------------- Sample Code -------------
for(int i=0;i<100;i++){
for(int j=0;j<10;j++){
TabPage page = new TabPage("we");
Panel a = new Panel();
a.AllowDrop = true;
page.Controls.Add(a );
this.tabControl1.TabPages.Add(page);
}
for(int k=0;k<10;k++){
this.tabControl1.TabPages[0].Controls.Clear();
this.tabControl1.TabPages.RemoveAt(0);
}
}
}
This might be something really straight fowward, but I have been debugging
my application.
I noticed some really unusual memory behaviour, after putting it through a
profile, I narrow
it down to the property AllowDrop = true.
I created some sample code, which simply adds a panel to a tab control 10
times, then removes
the control 10 times. If I have AllowDrop=true set the panel is never
destoryed in memory.
I am just interested in knowing why AllowDrop=true would stop the panel from
being destroyed ?
Thanks
Scott
------------- Sample Code -------------
for(int i=0;i<100;i++){
for(int j=0;j<10;j++){
TabPage page = new TabPage("we");
Panel a = new Panel();
a.AllowDrop = true;
page.Controls.Add(a );
this.tabControl1.TabPages.Add(page);
}
for(int k=0;k<10;k++){
this.tabControl1.TabPages[0].Controls.Clear();
this.tabControl1.TabPages.RemoveAt(0);
}
}
}