Completed
Last Updated: 03 Jun 2015 13:40 by ADMIN
ADMIN
Dimitar
Created on: 22 Apr 2015 07:49
Category: RichTextEditor
Type: Bug Report
2
FIX. RichTextEditorRibbonBar - memory leak when showing a form with RichTextEditorRibbonBar several times.
To reproduce:
- Add RichTextEditorRibbonBar to a form and open it upon button click several times.
- You will notice that the memory is constantly increasing.

Workaround:
protected override void Dispose(bool disposing)
{
    if (disposing && (components != null))
    {
        components.Dispose();
    }

    FieldInfo f1 = this.richTextEditorRibbonBar1.GetType().GetField("tabTableStyle", BindingFlags.NonPublic| BindingFlags.Instance);
    RichTextEditorRibbonTab tab1 = f1.GetValue(richTextEditorRibbonBar1) as RichTextEditorRibbonTab;
    tab1.Dispose();

    FieldInfo f2 = this.richTextEditorRibbonBar1.GetType().GetField("tabTableLayout", BindingFlags.NonPublic | BindingFlags.Instance);
    RichTextEditorRibbonTab tab2 = f2.GetValue(richTextEditorRibbonBar1) as RichTextEditorRibbonTab;
    tab2.Dispose();

    FieldInfo f3 = this.richTextEditorRibbonBar1.GetType().GetField("tabHeaderFooter", BindingFlags.NonPublic | BindingFlags.Instance);
    RichTextEditorRibbonTab tab3 = f3.GetValue(richTextEditorRibbonBar1) as RichTextEditorRibbonTab;
    tab3.Dispose();

    base.Dispose(disposing);
}
0 comments