]> Git trees. - libqmvoc.git/commitdiff
Create a new document until KEduVocDocument::open cleans up the old one.
authorFrederik Gladhorn <gladhorn@kde.org>
Wed, 14 Nov 2007 15:22:03 +0000 (15:22 +0000)
committerFrederik Gladhorn <gladhorn@kde.org>
Wed, 14 Nov 2007 15:22:03 +0000 (15:22 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=736688

keduvocdocument/sharedkvtmlfiles.cpp

index 624913d7a31733ba1bf05cf6d4d334ab6e4e95da..77fcbbb0b14e6cc0a86c041aad810e798a2ed0a2 100644 (file)
@@ -89,8 +89,10 @@ void SharedKvtmlFilesPrivate::rescan()
         }
     }
 
-    KEduVocDocument *doc = new KEduVocDocument();
+
     for ( int i = 0; i < this->m_fileList.size(); ++i ) {
+        KEduVocDocument *doc = new KEduVocDocument();
+
         // open the file
         doc->open( KUrl::fromPath( this->m_fileList[i] ) );
 
@@ -99,9 +101,8 @@ void SharedKvtmlFilesPrivate::rescan()
 
         // add it's comment to the comment list
         this->m_commentList.append( doc->documentComment() );
+        delete doc;
     }
-    // plug a memory leak
-    delete doc;
 }
 
 void SharedKvtmlFiles::rescan()