Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

memory with multiple windows opening and closing



  • I have an application with a loot of windows. And in every window, I close the current window and open an other window by doing this:

    close();
    mainMen = new MainMenu(get_this_peer(), username, this);
     mainMen->show();
    

    but the problem is that when i use this method, I see that my memory usage is going up. Is there a way to completely remove the current window and launch another window ?
    I have already tried setAttribute( Qt::WA_DeleteOnClose, true ) but it does not work


  • Qt Champions 2019

    @Mohammadreza99A said in memory with multiple windows opening and closing:

    I have already tried setAttribute( Qt::WA_DeleteOnClose, true ) but it does not work

    I does work, please show us a minimal code example which shows a memleak

    You should delete mainMen before assigning it a new value


Log in to reply