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

memory leak in QPushButton (under windows vista style)

    XMLWordPrintable

Details

    • 261bbb12003dab0e45b5814f85dd74aa64bcfb79

    Description

      There is memory leak when using QPushButton under windows vista style, the following code can produce this problem:

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

      { QApplication a(argc, argv); QPushButton w("button"); w.show(); int ret = a.exec(); // memory leak detection int tmp = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); tmp |= _CRTDBG_LEAK_CHECK_DF; _CrtSetDbgFlag(tmp); return ret; }

      Make sure you use windows vista style before run the program, press F5 to start the program, when the push button window is shown, hover the mouse pointer on the push button widget and then close the window, you will see memory leak report in the output window of visual studio. This leak will not occur in the following two cases:
      1) you didn't use windows vista style
      2) you didn't hover the mouse on the push button widget

      BTW: To test the program, I suggest you get the latest code of 4.8 branch from gitorious, this is because a memory leak of font engine object has been fixed a few days ago, if you don't get the latest code, the sample program will also be affected by that memory leak issue, which will confuse you.

      Attachments

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

        Activity

          People

            kleint Friedemann Kleint
            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