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

evaluateTo(QString*) leaks?, QXmlQuery

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P4: Low
    • None
    • 4.7.3
    • XML: QtXmlPatterns

    Description

      Hi!

      Following seems to leak memory.
      Or am I using something incorrectly?

      memoryLeakTest.cpp
      Code:
      
         QXmlQuery query(QXmlQuery::XSLT20);
      
         QString p1Name = "pointerBook";
         QString p1Value = "Contents";
      
         query.bindVariable(p1Name,QVariant(p1Value));
      
         // Just examples of an xml file and an xslt file.
      
         query.setFocus(QUrl(QString("/var/tmp/fileDoc.xml")));
         // The following xsl just returns a very simple html page:
         // <html> and <body> tags would just need to be added e.g. later.
         query.setQuery(QUrl(QString("/var/tmp/browse.xsl") ));
      
         for ( int i = 0; i < 700; i++ )
         {
              QString resString;
              // The following leaks memory?
              bool boolRes = query.evaluateTo( &resString );
         }
      

      (I have not tried with Qt 4.8.0.)

      My code leaks in the Desktop version (Qt 4.7.3, on Ubuntu) and on a Maemo device (N900), on the evaluateTo row.
      If the "evaluateTo" row is removed, then the application does not leak.

      Attachments

        1. browse.xsl
          7 kB
        2. fileDoc.xml
          1.41 MB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            laknoll Lars Knoll
            sruoh Ruutu
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes