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

Memory leak in QRawFont::setPixelSize() on Freetype

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.12.5
    • 5.12.3
    • GUI: Font handling
    • None
    • All
    • 89a25a3ef169cb42c54ef1ddcb28f70b24f923ab

    Description

      When cloning font engines on Freetype and using the cloned engines in QTextLayout, they may end up being cached in the QFontCache.

      Use the example in QT3DS-3617 to reproduce. Run it with Freetype on any platform, and you should see the memory grow really quickly per frame. What happens is that the text engine will create a multi font engine to contain the QRawFont engine and add this to the cache, probably as a work-around for something which does not work properly without a multi engine.

      Now, this is unnecessary in itself (maybe it should check if the font engine itself is cached and skip this skep if it is not). But on Windows GDI, the font engines are flushed from the cache when it grows too big, so the memory never grows beyond a certain point. On Freetype this doesn't happen, presumably because it thinks there are references to them. So it might be about some differences in how the initial references are set up on Freetype versus what is expected.

      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:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes