summaryrefslogtreecommitdiff
blob: aa6c2497fb0ef91c5689b8b438f11e6fe6180344 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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;
 }