[Mono-bugs] [Bug 386483] MenuStrip prevents Form from being GC'd

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon May 5 15:14:24 EDT 2008


User jpobst at novell.com added comment

Jonathan Pobst <jpobst at novell.com> changed:

           What    |Removed                                         |Added
           Severity|Normal                                          |Enhancement
            Summary|Form::MainMenuStrip prevents GC                 |MenuStrip prevents Form from being GC'd

--- Comment #1 from Jonathan Pobst <jpobst at novell.com>  2008-05-05 13:14:24 MST ---
Workaround committed in r102539.  If you call Form.Dispose (), the Form will be
able to be garbage collected.

The issue is that Tool/MenuStrips are added to a static collection in
ToolStripManager.  This allows them to grab keys like Alt to process even when
they are not the active control.  And the MenuStrip has a reference to its
parent, the Form.

To be fully fixed, ToolStripManager would need to be rewritten to pass messages
to the Tool/MenuStrips without holding a reference to them.

2008-05-05  Jonathan Pobst  <monkey at jpobst dot com>

        * ToolStrip.cs, ToolStripDropDownItem.cs: Make sure toolstrips are
        removed from the static toolstrips collection in ToolStripManager
        when they are disposed.  Provides a workaround for bug #386483.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list