Posted 20 years ago
by kh
- United Kingdom

Hi. I read another post on this group but the proposed solution does not work. The child of my window needs to be disposed and dereferenced, so I have trapped the DWManager window closing/closed events as described. Memory profiling shows that my control is still in memory. It is referenced from:
I have tried to fix this using the following (where manager is my DWManager object)
Can you please suggest how I can fix this. I am using v2.00.0207
kh
ActiproSoftware.TabStripPanel.TabStripPanelItem
System.Windows.Forms.Control+ControlNativeWindow
private void manager_DocumentWindowClosing(object sender, DWDocumentWindowEventArgs e)
{
KillDocumentWindow( e.DocumentWindow );
}
private void manager_DocumentWindowClosed(object sender, DWDocumentWindowEventArgs e)
{
KillDocumentWindow( e.DocumentWindow );
}
private void KillDocumentWindow( DWDocumentWindow win )
{
Control child = win.Child;
if( child != null )
{
if( child.Parent != null )
child.Parent.Controls.Remove( child );
child.Dispose();
}
}
kh