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. main.qml
          0.7 kB
        2. arrow.png
          arrow.png
          19 kB
        3. back.png
          back.png
          12 kB
        4. valgrind-log-5.9.1.text
          122 kB
        5. valgrind-log-5.9.0.text
          118 kB
        6. qtbug61754.tar.gz
          32 kB
        7. valgrind-log-5.9.1-fix-memory-leak.text
          93 kB
        8. qtbug61754-2.tar.gz
          159 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes