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

REG: Possible memory leak in DirectWrite font database

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1: Critical P1: Critical
    • 6.8.1
    • 6.8.0
    • GUI: Font handling
    • None
    • Windows
    • 2ea099b67 (dev), 247cd80ab (dev), 6dfe5c847 (6.8), 7bf79ee39 (6.8)

      Running a loop like the following:

          for (int j = 0; j < 100; ++j) {
              for (int i = 0; i < QFontDatabase::families().size(); ++i) {
                  QFontInfo fi(QFont(QFontDatabase::families().at(i)));
                  qDebug() << fi.family();
              }
      
              QFontDatabase::addApplicationFont(":/fooBar.ttf");
              QFontDatabase::removeAllApplicationFonts();
          }
      

      will lead to the application consuming 2GB of memory. The code to add and remove the application font is just to force an invalidate() call on the database so that it's repopulated. Calling the private API directly exhibits the same bug, so it's not caused by the application font loading.

      Running with "-platform windows:fontengine=gdi" works around the bug.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes