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

Minimal Platform Integration plugin leaks QMinimalScreen instance

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12.2
    • QPA
    • None

    Description

      The minimal platform integration plugin leaks its QMinimalScreen instance (found when running some headless tests using valgrind). The following patch seems to make it happy

      --- a/qtbase-everywhere-src-5_12_2/src/plugins/platforms/minimal/qminimalintegration.cpp
      +++ b/qtbase-everywhere-src-5_12_2/src/plugins/platforms/minimal/qminimalintegration.cpp
      @@ -102,17 +102,18 @@ QMinimalIntegration::QMinimalIntegration(const QStringList &parameters)
               m_options |= DebugBackingStore | EnableFonts;
           }
      
      -    QMinimalScreen *mPrimaryScreen = new QMinimalScreen();
      +    m_primaryScreen = new QMinimalScreen();
      
      -    mPrimaryScreen->mGeometry = QRect(0, 0, 240, 320);
      -    mPrimaryScreen->mDepth = 32;
      -    mPrimaryScreen->mFormat = QImage::Format_ARGB32_Premultiplied;
      +    m_primaryScreen->mGeometry = QRect(0, 0, 240, 320);
      +    m_primaryScreen->mDepth = 32;
      +    m_primaryScreen->mFormat = QImage::Format_ARGB32_Premultiplied;
      
      -    screenAdded(mPrimaryScreen);
      +    screenAdded(m_primaryScreen);
       }
      
       QMinimalIntegration::~QMinimalIntegration()
       {
      +    destroyScreen(m_primaryScreen);
           delete m_fontDatabase;
       }
      
      
      --- a/qtbase-everywhere-src-5_12_2/src/plugins/platforms/minimal/qminimalintegration.h
      +++ b/qtbase-everywhere-src-5_12_2/src/plugins/platforms/minimal/qminimalintegration.h
      @@ -89,6 +89,7 @@ public:
       private:
           mutable QPlatformFontDatabase *m_fontDatabase;
           unsigned m_options;
      +    QMinimalScreen *m_primaryScreen;
       };
      
       QT_END_NAMESPACE
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            cwgthornton Chris Thornton
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes