MaterialSkin icon indicating copy to clipboard operation
MaterialSkin copied to clipboard

when i close winform the dispose was not work

Open Suda0518 opened this issue 4 years ago • 9 comments

i have a question ,when i clsoing winform ,the form was closed ,but the process not stop,it was still runing,disposing was not disposed , it break at below :

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

Suda0518 avatar Mar 02 '20 13:03 Suda0518

version 2.12

Suda0518 avatar Mar 02 '20 13:03 Suda0518

only make this text control porperty in password mode ,this bug was happen

Suda0518 avatar Mar 03 '20 10:03 Suda0518

Did you resolve this? It seems to be a bug on your code, the example app has a textbox with password and this does not happen, every component is being disposed properly.

leocb avatar Mar 03 '20 14:03 leocb

I'm running intro the same issue, a simple connexion Form doesn't dispose properly if the textBox is set to Password. Removing it allow proper disposing... This seems only to happen if the password text box is not empty, really weird behavior... For now I'm just emptying it manually using materialTextBox.Text = "";

ThibaudMZN avatar Jun 02 '20 13:06 ThibaudMZN

This is probably the same problem as #67, it's related to using .net 4.7.x in your project (the lib is currently using 4.6). I don't know why or how to fix it yet.

leocb avatar Jun 02 '20 13:06 leocb

Indeed I'm using .Net 4.8 in the project so that could be the problem ! So yeah, a quick fix could be to make sure the Text property is empty on Dispose Event, that's what I did on my side..

ThibaudMZN avatar Jun 02 '20 14:06 ThibaudMZN

Thanks for reporting a fix!

leocb avatar Jun 02 '20 15:06 leocb

Hi guys,

I had the same problem using the materialTextBox set to Password . A quick fix that worked for me was setting adding the code below to the FormClosing event.

        private void LoginForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            //Close();
            Application.ExitThread();
            Environment.Exit(Environment.ExitCode);
        }

I am running this as a C# application on .NET Framework 4.7.2

Hope this helps.

Screenshot 2021-02-18 111128

Cale-Torino avatar Feb 18 '21 09:02 Cale-Torino

Thanks for reporting a fix!

leocb avatar Feb 18 '21 12:02 leocb