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. memory with multiple windows opening and closing
Forum Updated to NodeBB v4.3 + New Features

memory with multiple windows opening and closing

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 178 Views
  • 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.
  • M Offline
    M Offline
    Mohammadreza99A
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      3

      • Login

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