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

memory leak on ~QFile()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 4.6.2
    • Core: I/O
    • None

    Description

      I've got a memory leak show by Valgrind, when I try to delete a pointer that first I create like this:

      QString qxmlFile (strPathConfiguracion.c_str());
      QFile *xmlFile = new QFile(qxmlFile);
      xmlFile->open(QIODevice::ReadOnly);
      xmlFile->close();
      delete xmlFile;

      and I've got the next result by valgrind.

      120 bytes in 1 blocks are still reachable in loss record 5,745 of 7,447
      ==4942== at 0x4C27CC1: operator new(unsigned long) (vg_replace_malloc.c:261)
      ==4942== by 0xCB7FAA2: QMutex::QMutex(QMutex::RecursionMode) (in /usr/lib/libQtCore.so.4.6.2)
      ==4942== by 0xCB80EE2: QMutexPool::get(void const*) (in /usr/lib/libQtCore.so.4.6.2)
      ==4942== by 0xCC8E822: QObject::~QObject() (in /usr/lib/libQtCore.so.4.6.2)
      ==4942== by 0xCC06AD2: QFile::~QFile() (in /usr/lib/libQtCore.so.4.6.2)
      ==4942== by 0x15379F1: Iberdrola::MRR::General::Configuracion::CBaseConfiguracion::ValidarXml(std::string) (CBaseConfiguracion.cpp:270)

      If this is something that I do wrong, please let me know, but I think that is simple and it's right.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            vicentemangas Alberto Vicente Mangas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes