From: Frederik Gladhorn Date: Wed, 14 Nov 2007 15:22:03 +0000 (+0000) Subject: Create a new document until KEduVocDocument::open cleans up the old one. X-Git-Tag: v3.97.0~13 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=a63b84400c12e407169d7b571f88685307d5b9a5;p=libqmvoc.git Create a new document until KEduVocDocument::open cleans up the old one. svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=736688 --- diff --git a/keduvocdocument/sharedkvtmlfiles.cpp b/keduvocdocument/sharedkvtmlfiles.cpp index 624913d..77fcbbb 100644 --- a/keduvocdocument/sharedkvtmlfiles.cpp +++ b/keduvocdocument/sharedkvtmlfiles.cpp @@ -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()