mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
- Do not save torrent related info in class destruction, this is too dangerous
This commit is contained in:
parent
8404eec301
commit
fd2ee35e92
@ -503,6 +503,9 @@ void GUI::closeEvent(QCloseEvent *e) {
|
|||||||
}
|
}
|
||||||
// Save window size, columns size
|
// Save window size, columns size
|
||||||
writeSettings();
|
writeSettings();
|
||||||
|
// Do some BT related saving
|
||||||
|
BTSession->saveDHTEntry();
|
||||||
|
BTSession->saveFastResumeAndRatioData();
|
||||||
// Accept exit
|
// Accept exit
|
||||||
e->accept();
|
e->accept();
|
||||||
qApp->exit();
|
qApp->exit();
|
||||||
|
@ -85,9 +85,6 @@ bittorrent::~bittorrent() {
|
|||||||
delete timerAlerts;
|
delete timerAlerts;
|
||||||
delete ETARefresher;
|
delete ETARefresher;
|
||||||
delete downloader;
|
delete downloader;
|
||||||
// Do some saving
|
|
||||||
saveDHTEntry();
|
|
||||||
saveFastResumeAndRatioData();
|
|
||||||
// Delete BT session
|
// Delete BT session
|
||||||
delete s;
|
delete s;
|
||||||
}
|
}
|
||||||
@ -383,15 +380,15 @@ void bittorrent::addTorrent(QString path, bool fromScanDir, QString from_url) {
|
|||||||
QString old_hash = fi.baseName();
|
QString old_hash = fi.baseName();
|
||||||
if(old_hash != hash){
|
if(old_hash != hash){
|
||||||
qDebug("* ERROR: Strange, hash changed from %s to %s", old_hash.toUtf8().data(), hash.toUtf8().data());
|
qDebug("* ERROR: Strange, hash changed from %s to %s", old_hash.toUtf8().data(), hash.toUtf8().data());
|
||||||
QStringList filters;
|
// QStringList filters;
|
||||||
filters << old_hash+".*";
|
// filters << old_hash+".*";
|
||||||
QStringList files = torrentBackup.entryList(filters, QDir::Files, QDir::Unsorted);
|
// QStringList files = torrentBackup.entryList(filters, QDir::Files, QDir::Unsorted);
|
||||||
QString my_f;
|
// QString my_f;
|
||||||
foreach(my_f, files) {
|
// foreach(my_f, files) {
|
||||||
qDebug("* deleting %s", my_f.toUtf8().data());
|
// qDebug("* deleting %s", my_f.toUtf8().data());
|
||||||
torrentBackup.remove(my_f);
|
// torrentBackup.remove(my_f);
|
||||||
}
|
// }
|
||||||
return;
|
// return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(s->find_torrent(t.info_hash()).is_valid()) {
|
if(s->find_torrent(t.info_hash()).is_valid()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user