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

Memory leak when using boudingRect on QThread

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 4.8.6
    • GUI: Text handling
    • None
    • Linux/X11

    Description

      Hello,

      A memory leak is present when calling the boundingRect function in QFontMetrics (as well as drawText from QPainter) in a QThread.  In analyzing the source code for the two functions, I noticed they both made QStackTextEngine objects which are referenced in this bug report https://bugreports.qt.io/browse/QTBUG-24685 as causing a leak in version 4.7.4 and 4.8.  Supposedly the bug was fixed in 4.8.3 but it seems to be occuring in version 4.8.6 as well. I have attached images showing the memory increase when calling boundingRect with a QString of len == 0 (which returns the function before creating a QStackTextEngine and manipulating it) and one with  a QString of len != 0.  The first one has a RAM usage that is constant whereas the second has a RAM that increases steadily.

      In the images, the process concerned is called "Exemple"

      My question is, has this leak been corrected in a newer version or is it still a bug in Qt?

      Thank you in advance. 

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            blcg B L
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes