Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-61754

Change image source cause memory leak

    XMLWordPrintable

Details

    • 768f606cd3cd37c235e85225127201a42d272946

    Description

      This not affects with 5.9.0 and 5.8.0. An example in attachment. 

      Here's main.qml from the attachment:

      main.qml
      import QtQuick 2.7
      import QtQuick.Controls 2.1
      
      ApplicationWindow {
          visible: true
          width: 800
          height: 600
      
          Timer {
              interval: 200
              repeat: true
              running: true
              onTriggered: {
                  var tmp = fstImage.source
                  fstImage.source = sndImage.source
                  sndImage.source = tmp
              }
          }
      
          Row {
              Image {
                  id: fstImage
                  width: 400
                  cache: false
                  source: 'qrc:/images/arrow.png'
                  fillMode: Image.PreserveAspectFit
              }
      
              Image {
                  id: sndImage
                  width: 400
                  cache: false
                  source: 'qrc:/images/back.png'
                  fillMode: Image.PreserveAspectFit
              }
          }
      }
      

      Attachments

        1. arrow.png
          19 kB
          Amin Cheloh
        2. back.png
          12 kB
          Amin Cheloh
        3. main.qml
          0.7 kB
          Amin Cheloh
        4. qtbug61754.tar.gz
          32 kB
          Mitch Curtis
        5. qtbug61754-2.tar.gz
          159 kB
          Joni Poikelin
        6. valgrind-log-5.9.0.text
          118 kB
          Amin Cheloh
        7. valgrind-log-5.9.1.text
          122 kB
          Amin Cheloh
        8. valgrind-log-5.9.1-fix-memory-leak.text
          93 kB
          Amin Cheloh

        Issue Links

          Activity

            People

              poikelin Joni Poikelin
              amincheloh Amin Cheloh
              Votes:
              5 Vote for this issue
              Watchers:
              18 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: