Blob Blame History Raw
diff -up qt-x11-opensource-src-4.5.0/tools/linguist/shared/profileevaluator.cpp.orig qt-x11-opensource-src-4.5.0/tools/linguist/shared/profileevaluator.cpp
--- qt-x11-opensource-src-4.5.0/tools/linguist/shared/profileevaluator.cpp.orig	2009-03-16 12:50:03.000000000 +0100
+++ qt-x11-opensource-src-4.5.0/tools/linguist/shared/profileevaluator.cpp	2009-03-17 00:42:51.000000000 +0100
@@ -86,6 +86,7 @@ public:
     void enterScope(bool multiLine);
     void leaveScope();
     void finalizeBlock();
+    void cleanup();
 
     // implementation of AbstractProItemVisitor
     bool visitBeginProBlock(ProBlock *block);
@@ -164,6 +165,15 @@ ProFileEvaluator::Private::Private(ProFi
     m_contNextLine = false;
 }
 
+void ProFileEvaluator::Private::cleanup()
+{
+    m_commentItem = 0;
+    m_block = 0;
+    m_proitem.clear();
+    m_blockstack.clear();
+    m_pendingComment.clear();
+}
+
 bool ProFileEvaluator::Private::read(ProFile *pro)
 {
     QFile file(pro->fileName());
@@ -180,11 +190,14 @@ bool ProFileEvaluator::Private::read(Pro
     while (!ts.atEnd()) {
         QString line = ts.readLine();
         if (!parseLine(line)) {
+            cleanup();
             q->errorMessage(format(".pro parse failure."));
             return false;
         }
         ++m_lineNo;
     }
+
+    cleanup();
     return true;
 }