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

Crash during application shutdown, in freetype

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.2.0
    • GUI: Font handling
    • None

      Our application uses font rendering in threads.
      All works fine, until the application exists.
      Then the cleanup kicks in and executes in qfontengine_ft.cpp:

      void QFreetypeFace::release(const QFontEngine::FaceId &face_id)
      {
      QtFreetypeData *freetypeData = qt_getFreetypeData();
      if (!ref.deref()) {
      if (hbFace && hbFace_destroy_func)

      { hbFace_destroy_func(hbFace); hbFace = 0; }

      FT_Done_Face(face);
      if(freetypeData->faces.contains(face_id))
      freetypeData->faces.take(face_id);
      delete this;
      }
      if (freetypeData->faces.isEmpty())

      { FT_Done_FreeType(freetypeData->library); freetypeData->library = 0; }

      }

      This calls FT_Done_Face, which itself will access global lists in the driver of this face.

      That seems to cause problems if multiple threads do this in parallel (e.g. segfaults).

      Might it be needed to guard calls to Done_Face (or the complete ::release) with some Qt-global mutex? (still that seems like a hack, as other libraries might use freetype, still...)

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

            esabraha Eskil Abrahamsen Blomfeldt
            cullmann Christoph Cullmann
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes