Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt double free or corruption
Qt 6.11 is out! See what's new in the release blog

Qt double free or corruption

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 2.8k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • madababiM Offline
    madababiM Offline
    madababi
    wrote on last edited by
    #1

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

    this->~Authentification();
    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

    kshegunovK 1 Reply Last reply
    0
    • madababiM madababi

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

      this->~Authentification();
      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

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by kshegunov
      #2

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

      this->~Authentification();
      

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

      Kind regards.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      3
      • madababiM Offline
        madababiM Offline
        madababi
        wrote on last edited by
        #3

        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.

        mrjjM 1 Reply Last reply
        0
        • madababiM madababi

          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.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

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

          1 Reply Last reply
          6
          • madababiM Offline
            madababiM Offline
            madababi
            wrote on last edited by
            #5

            @mrjj
            Thanks it works very well.

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved