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

QDomElement destructor causes a crash when calling QDomNamedNodeMapPrivate::clearMap() in Qt 4.6

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.6.2
    • XML: DOM
    • None
    • Windows

    Description

      The following code reproduces the problem (this behaviour definitely was not present in Qt 4.4.x):-

      #include <QtCore/QCoreApplication> 
      #include <QDomElement> 
      
      class DataType 
      { 
      public: 
      	virtual ~DataType() {} 
      
      	QDomElement Serialize() const 
      	{ 
      		QDomDocument xmld; 
      		QDomElement xmle = xmld.createElement("DataType"); // ret val 
      
      		// add some attributes... 
      		xmle.setAttribute("Name","I'm Qt!"); 
      
      		return xmle; 
      	} 
      }; 
      
      class IntegerDataType : public DataType 
      { 
      public: 
      	QDomElement Serialize() const 
      	{ 
      		QDomElement xmle = DataType::Serialize(); 
      
      		xmle.setAttribute("Value","10"); 
      
      		return xmle; 
      	} 
      }; 
      
      int main(int argc, char *argv[]) 
      { 
      	QCoreApplication app(argc, argv); 
      
      	IntegerDataType obj; 
      
      	{ 
      		QDomElement xmle = obj.Serialize(); 
      
      		// Then append the domelement to a domdocument which will be saved to the disk etc etc... 
      	} 
      
      	return 0; 
      } 
      

      Attachments

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

        Activity

          People

            phartman Peter Hartmann (closed Nokia identity) (Inactive)
            cattell Matthew Cattell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes