Parser crash

Caleb Tennis caleb at aei-tech.com
Wed Apr 2 20:12:04 UTC 2003


On Tuesday 01 April 2003 12:41 pm, Amilcar do Carmo Lucas wrote:
> Gideon CVS today crashes every time I save a .h file

I can't reproduce this, but does this patch solve the problem?

diff -u -3 -p -r1.26 classstore.cpp
--- classstore.cpp      20 Mar 2003 14:06:59 -0000      1.26
+++ classstore.cpp      2 Apr 2003 17:19:55 -0000
@@ -486,13 +486,20 @@ void ClassStore::removeWithReferences(co
 {
     for (QMap<QString, ParsedScopeContainer*>::Iterator it = 
m_allScopes.begin(); it != m_allScopes.end(); ++it)
         removeWithReferences(fileName, *it);
-    for (QMap<QString, ParsedClass*>::Iterator it = m_allClasses.begin(); it 
!= m_allClasses.end(); ++it) {
-        if ( (*it)->declaredInFile() == fileName )
+
+    QMap<QString, ParsedClass*>::Iterator it = m_allClasses.begin();
+
+    while(it != m_allClasses.end()) {
+        if ( (*it)->declaredInFile() == fileName )
             m_allClasses.remove( it );
+        else it++;
     }
-    for (QMap<QString, ParsedClass*>::Iterator it = m_allStructs.begin(); it 
!= m_allStructs.end(); ++it) {
+
+    it = m_allStructs.begin();
+    while(it != m_allStructs.end()) {
         if ( (*it)->declaredInFile() == fileName )
             m_allStructs.remove( it );
+        else it++;
     }
     removeWithReferences(fileName, m_globalScope);
 }





More information about the KDevelop-devel mailing list