Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HashTable Refrences to control Unable to be Cleared in HelpProvider.CS/ Documentation error #2680

Open
TendyTree opened this issue Jan 9, 2020 · 2 comments

Comments

@TendyTree
Copy link

@TendyTree TendyTree commented Jan 9, 2020

  • .NET Core Version: (e.g. 3.0 Preview1, or daily build number, use dotnet --info)
    Framework 4.5
  • Have you experienced this same bug with .NET Framework?: Yes/No
    Yes

Problem description:
I have a form with a single instance of a help provider. On this form I dynamical create and destroy buttons, which on creation I assign a it a SetHelpString and add it to a flow layout panel. On a deletion of a buttons I have no way to remove the control from the hash table reference on the help provider even with calling ResetShowHelp, leading to the hash table growing in memory, specifically _helpStrings( This could also affect the other hash tables as well)
Actual behavior:
Calling ResetShowHelp does not clear the control from all the hash tables, leading to the hash table growing in memory, specifically _helpStrings( This could also affect the other hash tables as well)
Expected behavior:
According to the .Net Docs

ResetShowHelp(Control) | Removes the Help associated with the specified control.

This only remove the the control from the _showHelp Hashtable, shown in the code bellow. The expected out come would be that it to removes all references to that HelpProvider for that specific control

Minimal repro:
HelpProvider.cs

    private readonly Hashtable _helpStrings = new Hashtable();
    private readonly Hashtable _showHelp = new Hashtable();
    private readonly Hashtable _boundControls = new Hashtable();
    private readonly Hashtable _keywords = new Hashtable();
    private readonly Hashtable _navigators = new Hashtable();



    public virtual void ResetShowHelp(Control ctl)
    {
        if (ctl == null)
        {
            throw new ArgumentNullException(nameof(ctl));
        }

        _showHelp.Remove(ctl);
    }
@RussKie

This comment has been minimized.

Copy link
Member

@RussKie RussKie commented Jan 10, 2020

This repo is for Windows Forms on .NET Core/.NET. Please report all .NET Framework related issues via VS Feedback (there's an icon at the top right hand side of VS).

If you provide a small repro project targeting .NET Core/.NET that exhibits the observed behavior we can have a look at it.
You can also pull the source down and send a fix in 😉

@TendyTree

This comment has been minimized.

Copy link
Author

@TendyTree TendyTree commented Jan 10, 2020

Alright, thank you for pointing me in the right direction. Hopefully I'll get to it in the next couple of hours

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.