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

memory leak in QPainter::drawText()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.8.0
    • 4.7.4, 4.8.0
    • GUI: Font handling
    • None
    • windows 7 x64
      vs2010
    • b62dc3277c4d41cc99d37c457e3a55842879e0b1

    Description

      Qt-4.8 has memory leak in QPainter::drawText(), the following code can reproduce this problem:

      int main(int argc, char *argv[])
      {
      QApplication a(argc, argv);

      { QImage img(512, 512, QImage::Format_ARGB32_Premultiplied); QPainter p(&img); p.drawText(0, 0, "Hello!"); }

      #ifdef _MSC_VER
      //////////////////////////////////////////////////////////////////////////
      // memory leak detection
      //////////////////////////////////////////////////////////////////////////

      // get the current state of the flag
      int nCrtDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
      // set memory leak check flag
      nCrtDbgFlag |= _CRTDBG_LEAK_CHECK_DF;
      // set the new debug flag
      _CrtSetDbgFlag(nCrtDbgFlag);
      #endif

      return 0;
      }

      To reproduce this problem you have to run this program by vistual studio in windows, start the program by pressing F5 and after the program exited you will see memory leaks report in the output window of visual studio.

      Attachments

        Issue Links

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

          Activity

            People

              jiang Jiang Jiang
              jianliang79 liang jian
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes