Qt double free or corruption

  • I developed a QT application that has an authentication widget and a main window. After authentication succeed I open the mainWindow using this code

    MainWindow *w= new MainWindow(); 

    but after I close the main window I receive a double free or corruption error. the debug said that the source of this error is

    delete ui;

    from the class Authentification

  • Qt Champions 2017

    @madababi said:
    I'm pretty sure this line is wrong (you can glance at this for more information):


    Remove it and try again. If the problem persist extract the strack trace and post it here, please.

    Kind regards.

  • thanks @kshegunov
    yes the problem disappear but I need to close the authentification window and open the mainwondow.
    what's the best way to do that.

  • Qt Champions 2017

    Hi cant you just call close();
    on the Authentification ?

  • @mrjj
    Thanks it works very well.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.