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

memory leak in QPainter::drawText() when using QOpenGLPaintEngine

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 4.7.1
    • 4.5.3
    • GUI: OpenGL
    • None
    • windows 7, visual studio 2005
    • c2dca4c9f1eb360305de5ea520a0b322737dc600

    Description

      run the following program, you will see several memory leaks.

      class CGLWidget : public QGLWidget
      {
      public:
      CGLWidget(QWidget *parent = 0) : QGLWidget(QGLFormat(QGL::DoubleBuffer | QGL::SampleBuffers), parent)
      {
      }

      protected:
      virtual void paintEvent(QPaintEvent *e)
      {
      makeCurrent();

      { QPainter painter(this); painter.setRenderHint(QPainter::TextAntialiasing); painter.setPen(Qt::red); painter.drawText(100, 100, "Hello!"); }

      swapBuffers();
      }
      };

      int main(int argc, char *argv[])

      { QApplication a(argc, argv); CGLWidget w; w.show(); int ret = a.exec(); // 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); return ret; }

      Attachments

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

        Activity

          People

            rweather Rhys Weatherley (closed Nokia identity) (Inactive)
            jianliang79 liang jian
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes