Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. qml loader male memory leak!

qml loader male memory leak!

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlloadermemory leakc++qt5.9.2
2 Posts 2 Posters 1.1k 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.
  • S Offline
    S Offline
    Saman19
    wrote on 30 May 2018, 13:03 last edited by
    #1

    Hi.
    I am writing an application with c++ and qml....
    I used loader on qml but every time qml load a new page make memory leak!!!
    Here is my codes:
    Window {
    Loader {
    id: windowLoader
    source: "main.qml"
    focus: true
    }

        Connections {
            ignoreUnknownSignals: true
            target: windowLoader.item
            onChangeToPagemenuFromPermision: {
                windowLoader.source = ""
                windowLoader.source = "PageMenu.qml"
            }
    

    }

        Connections {
            ignoreUnknownSignals: true
            target: windowLoader.item
            onChangeTomainmenu: {
                windowLoader.source = ""
    
                windowLoader.source = "main.qml"
            }
    

    }
    }

    Rectangle {
    id: main
    visible: true
    ...
    }

    Rectangle {
    id: pagemenu
    visible: true
    ...
    }
    In the beginning, the amount of memory is equal to 37.2 mb, When I open the new page, the amount of memory will be 40 mb. And at the end, when going back to the first page, the amount of memory is 39 mb, instead of 37.2 mb

    please help me to solve this...
    Best Regards.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dheerendra
      Qt Champions 2022
      wrote on 1 Jun 2018, 13:05 last edited by
      #2

      Just by loading one page and coming back, we can't make out the memory leak. Try multiple times like this. If you see a increase & no decrease then we can conclude memory leak. If you can send me the complete example, we can try as well.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      1

      1/2

      30 May 2018, 13:03

      • Login

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