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

Memory leak in QSGFramebufferObjectNode

    XMLWordPrintable

Details

    • 243b819ff73f6aaa9dc068d43b8b918a98f53663

    Description

      There's a memory leak when setting texture to QSGFramebufferObjectNode object in QQuickFramebufferObject::updatePaintNode() function defined in qtdeclarative/src/quick/items/qquickframebufferobject.cpp

      n->setTexture(window()->createTextureFromId(displayTexture,
                                  n->fbo->size(),
                                  QQuickWindow::TextureHasAlphaChannel));
      

      If QSGFramebufferObjectNode object already owns the texture that one is not released, causing memory leak.

      QSGFramebufferObjectNode is managing the lifetime of the texture manually without using parent class QSGSimpleTextureNode::setOwnsTexture() function, as suggested by this code in its destructor:

      ~QSGFramebufferObjectNode()
      {
          delete renderer;
          delete texture();   // << HERE
          delete fbo;
          delete msDisplayFbo;
      }

      Is there a reason why it does not make use of setOwnsTexture()?

      Attachments

        For Gerrit Dashboard: QTBUG-65156
        # Subject Branch Project Status CR V

        Activity

          People

            lagocs Laszlo Agocs
            pavol.markovic Pavol Markovic
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes