From c41d17043c5dd68b17516632619bf68a905fce34 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 23 Dec 2008 15:51:32 +0000 Subject: [PATCH] - Fixed another memory leak in torrent addition dialog --- src/torrentAddition.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/torrentAddition.h b/src/torrentAddition.h index 304dc8a94..2b8499947 100644 --- a/src/torrentAddition.h +++ b/src/torrentAddition.h @@ -96,6 +96,7 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{ ~torrentAdditionDialog() { delete PropDelegate; + delete PropListModel; } void showLoad(QString filePath, bool fromScanDir=false, QString from_url=QString::null){ @@ -157,10 +158,11 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{ // TODO: row Color? // Add the child to the tree parent->appendRow(child); - // Add childs - torrent_file *childFile; - foreach(childFile, root->getChildren()) { - addFilesToTree(childFile, first); + // Add children + QList children = root->getChildren(); + unsigned int nbChildren = children.size(); + for(unsigned int i=0; i < nbChildren; ++i) { + addFilesToTree(children.at(i), first); } }