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

QThreadData is leaked in main thread

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.1.0
    • 5.1.0
    • Core: Threads
    • None
    • Windows 7 x64
      VS2010
    • 7dc622290bb8e81af634034f443e25be0d6d48a3 950b35cf97ad398f97883efd2a18ee97994a8a9c

    Description

      A QThreadData object leak of the main thread(GUI thread) has been introduced in change https://codereview.qt-project.org/#change,45187
      Run the following program in VS2010, you can see the leak report

      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QWidget w;
          w.show();
      
          int ret = a.exec();
      
          // turn on memory leak detection
          int nCrtDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
          nCrtDbgFlag |= _CRTDBG_LEAK_CHECK_DF;
          _CrtSetDbgFlag(nCrtDbgFlag);
      
          return ret;
      }
      

      The removed lines in src/corelib/kernel/qcoreapplication.cpp caused this leak, it prevent the refcount of QThreadData from being dropped to zero on app exit.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            jianliang79 liang jian
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes