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

Memory leak when using QMessageBox

    XMLWordPrintable

Details

    Description

      Visual Studio reports memory leaks when running the following example.

      int main(int argc, char *argv[])
      {
          //Enable memory leak detection
          int tmp = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
          tmp |= _CRTDBG_LEAK_CHECK_DF;
          _CrtSetDbgFlag(tmp);
      
          QApplication app(argc, argv);
          QMessageBox::aboutQt(NULL);
      
          return 0;
      }
      

      Report from Visual Studio

      Detected memory leaks!
      Dumping objects ->
      {1710} normal block at 0x01FC7758, 1024 bytes long.
       Data: <            jw  > 01 00 00 00 F6 01 00 00 DA 01 00 00 6A 77 FC 01 
      {1622} normal block at 0x01FC51B8, 4 bytes long.
       Data: <Xw  > 58 77 FC 01 
      Object dump complete.
      

      Report from Visual Leak Detector

      ---------- Block 1710 at 0x0208AE48: 1024 bytes ----------
        Call Stack:
          0x6703EB6D (File and line number not available): qMalloc
          0x670A1BAF (File and line number not available): QString::realloc
          0x670A1B28 (File and line number not available): QString::resize
          0x670AAF59 (File and line number not available): replaceArgEscapes
          0x670AACA2 (File and line number not available): QString::arg
          0x655F3622 (File and line number not available): QMessageBoxPrivate::retranslateStrings
          0x655F0B2F (File and line number not available): QMessageBoxPrivate::init
          0x655F1460 (File and line number not available): QMessageBox::QMessageBox
          0x655F2D72 (File and line number not available): QMessageBox::aboutQt
      
      
      
      ---------- Block 1622 at 0x02085C68: 4 bytes ----------
        Call Stack:
          0x655F06D7 (File and line number not available): QMessageBoxPrivate::init
          0x655F1460 (File and line number not available): QMessageBox::QMessageBox
          0x655F2D72 (File and line number not available): QMessageBox::aboutQt
      

      Attachments

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

        Activity

          People

            ylopes Yoann Lopes
            cdagneau Clement Dagneau
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes