We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Docking Manager memory leak

Thread ID:

Created:

Updated:

Platform:

Replies:

67761 Aug 29,2007 01:23 PM Aug 19,2011 02:08 PM Windows Forms 8
loading
Tags: Tools
Yuval
Asked On August 29, 2007 01:23 PM

Hi,
I am programming with c# visual studio 2005 and syncfusion 4.4

I Create DockingManager and insert to there a form.
for remove the form from the DockingManager i write the next code:

m_DockingManager.EnableDock(myForm, false);
myForm.Parent = null;

This code remove the form from the controlsArray in the DockingManager but when i run the .net memory profiler to check if the form is really release from the memory,i discoverer that the DockingManager still holding the form in inner hashtable.bucket[] member.

how i absolutely remove the form from the docking manager?

Thanks,
Yuval

Golda Rebecal [Syncfusion]
Replied On September 1, 2007 08:48 AM

Hi Yuval,

Sorry for the delay in responding.

I am afraid that I am not able to reproduce the issue you have mentioned. Please refer to the sample that I used to test this issue and .NET profiler result available in the link given below:
http://websamples.syncfusion.com/samples/Tools.Windows/F67761/main.htm

In the attached sample, I have removed a form from the DockingManager in a ButtonClick event. I checked it in .NET profiler and I could not find the issue you have mentioned.

Could you please provide a sample having the issue? This will help us to resolve the issue soon.

We appreciate your interest in Syncfusion products.

Best regards,
Golda

Yuriy Zubarev
Replied On September 2, 2007 03:54 PM

I was reporting memory leaks since early versions of Essential Tools at least two years ago and Syncfusion never addressed the issue. I don't believe they ever will.

Yuval
Replied On September 3, 2007 01:12 PM

Thank you on the answer!

This code is casued to the memory leak:

public class Form1 : Form
{
UserControl uc;

public Form1()
{
// In the initializeComponenet i add a DockingManager class and 2 button
InitializeComponenet();

uc = new UserControl();
}

// Add UserControl to the docking manager
private void button1_Click(object sender, EventArgs e)
{
// The paramters for the rectangle doesn't matter
Rectanagle rec = new System.Drawing.Rectangle(200, 200, 200, 100);

dockingManager1.FloatControl(uc, rec);
dockingManager1.DockControl(uc, this, DockingStyle.Tabbed, 200);

// This 2 rows is caused the memory leak, without this rows the uc is relese from the memory
dockingManager1.SetDockAbility(uc, DockAbility.None);
dockingManager1.SetOuterDockAbility(uc, DockAbility.None);
}

// Remove User Control From the docking manager
private void button2_Click(object sender, EventArgs e)
{
dockingManager1.SetEnableDocking(uc, false);
uc.Parent = null;
uc = null;
}

}



thanks,
yuval

Mohamed Suhaib Fahad A. [Syncfusion]
Replied On September 6, 2007 10:05 AM

Hi Yuval,

Sorry for the delay.

I have identified the memory leak is in DockStateControllerWrapper is not getting disposed when the object closes. I have filed a defect report for this. This would be analysed so that there are no code breaks and fixed appropriately.

The architecture of DockingManager is very big, we are working up on cleaning up all the unwanted objects that stays there in the memory. However, in our future releases we expect each product to be cleaned up from memory leaks.

Please let me know if you want any more details.

Regards,
Fahad

Ampelio
Replied On April 22, 2008 11:28 AM

>The architecture of DockingManager is very big, we are working up on cleaning up all the unwanted objects that stays there in the memory. However, in our future releases we expect each product to be cleaned up from memory leaks.

Considering that the Memory Leaks problems are still present in 6.2.x.x, what do you mean "exaclty" when you say "in our future releases we expect each product to be cleaned up from memory leaks"?


Administrator [Syncfusion]
Replied On May 9, 2008 09:14 PM

I confirm this is still happening in 6.2 also;
Seems to affect any MDI child form.

Using tabbed mdi.

I am not seeing it referenced by a DockingStateControllerWrapper; it appears to be referenced as a key of one of DockingMananger's private hashtables.




Administrator [Syncfusion]
Replied On May 9, 2008 09:51 PM

If you add this derived class:
internal class DockingManagerExtended:Syncfusion.Windows.Forms.Tools.DockingManager
{
public DockingManagerExtended():base()
{
}
public DockingManagerExtended(System.ComponentModel.IContainer container)
: base(container)
{
}

public void PurgeControlReference(Control ctrl)
{
this.SetEnableDocking(ctrl, false);
// Remove the control from the extended property hashtables
if (this.htText.Contains(ctrl)) this.htText.Remove(ctrl);
if (this.htIcon.Contains(ctrl)) this.htIcon.Remove(ctrl);
if (this.htFloatOnly.Contains(ctrl)) this.htFloatOnly.Remove(ctrl);
if (this.htHiddenOnLoad.Contains(ctrl)) this.htHiddenOnLoad.Remove(ctrl);
if (this.htAllowFloating.Contains(ctrl)) this.htAllowFloating.Remove(ctrl);
if (this.htCustomCaptionButtons.Contains(ctrl)) this.htCustomCaptionButtons.Remove(ctrl);
if (this.htDockAbility.Contains(ctrl)) this.htDockAbility.Remove(ctrl);
if (this.htOuterDockAbility.Contains(ctrl)) this.htOuterDockAbility.Remove(ctrl);

}
}



and call that method on the dispose event of the child forms; it seems to release the references.
In my app, it seems that htAllowFloating was always culprit


Cyril George
Replied On August 19, 2011 02:08 PM

Perfect Syncfusion -- way to go!
This issue exists in 9.1 too.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;