From fd2ee35e92b560c9f45024a61201f67e4db8ce69 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 26 Aug 2007 19:58:41 +0000 Subject: [PATCH] - Do not save torrent related info in class destruction, this is too dangerous --- src/GUI.cpp | 3 +++ src/bittorrent.cpp | 21 +++++++++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/GUI.cpp b/src/GUI.cpp index 641ad6d76..1d34d7f43 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -503,6 +503,9 @@ void GUI::closeEvent(QCloseEvent *e) { } // Save window size, columns size writeSettings(); + // Do some BT related saving + BTSession->saveDHTEntry(); + BTSession->saveFastResumeAndRatioData(); // Accept exit e->accept(); qApp->exit(); diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 62c8c3ac9..88556204c 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -85,9 +85,6 @@ bittorrent::~bittorrent() { delete timerAlerts; delete ETARefresher; delete downloader; - // Do some saving - saveDHTEntry(); - saveFastResumeAndRatioData(); // Delete BT session delete s; } @@ -383,15 +380,15 @@ void bittorrent::addTorrent(QString path, bool fromScanDir, QString from_url) { QString old_hash = fi.baseName(); if(old_hash != hash){ qDebug("* ERROR: Strange, hash changed from %s to %s", old_hash.toUtf8().data(), hash.toUtf8().data()); - QStringList filters; - filters << old_hash+".*"; - QStringList files = torrentBackup.entryList(filters, QDir::Files, QDir::Unsorted); - QString my_f; - foreach(my_f, files) { - qDebug("* deleting %s", my_f.toUtf8().data()); - torrentBackup.remove(my_f); - } - return; +// QStringList filters; +// filters << old_hash+".*"; +// QStringList files = torrentBackup.entryList(filters, QDir::Files, QDir::Unsorted); +// QString my_f; +// foreach(my_f, files) { +// qDebug("* deleting %s", my_f.toUtf8().data()); +// torrentBackup.remove(my_f); +// } +// return; } } if(s->find_torrent(t.info_hash()).is_valid()) {