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

REG: Memory leak when loading/unloading application fonts

    XMLWordPrintable

Details

    • All
    • eed2ee69a (dev), 1f6b5f1d4 (6.6), 1001b385f (6.5)

    Description

      Running a loop which does the following demonstrates a memory leak:

      1. QFontDatabase::removeAllApplicationFonts()
      2. QFontDatabase::addApplicationFont(font1);
      3. Set font1 on Text element
      4. QFontDatabase::removeAllApplicationFonts()
      5. QFontDatabase::addApplicationFont(font2);
      6. Set font2 on Text element

      One issue is that isActive() on the distance field cache will never return false because for some reason not all glyphs are dereferenced. This should not cause any leak in this case however, since it will just mean the glyph cache is reused the next time the font is loaded. In fact, it is how all distance field glyph caches were handled prior to Qt 6.4.0 (they were never released)

      The leak is also observable (and even larger) with NativeRendering, which indicates that we are actually leaking QFontEngines (which in turn contain glyph caches in the case of NativeRendering, so the impact would be greater).

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            esabraha Eskil Abrahamsen Blomfeldt
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes