From 45efcfce13ef8863d3e9370c876bf58f428c7a99 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sat, 27 Dec 2008 10:02:42 +0000 Subject: [PATCH] - Save session data and fast resume data sooner on exit (in case) --- src/GUI.cpp | 4 ++++ src/bittorrent.cpp | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/GUI.cpp b/src/GUI.cpp index 11f520387..a83c7514e 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -241,6 +241,10 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis GUI::~GUI() { qDebug("GUI destruction"); hide(); + // Do this as soon as possible + BTSession->saveDHTEntry(); + BTSession->saveSessionState(); + BTSession->saveFastResumeData(); delete dlSpeedLbl; delete upSpeedLbl; delete ratioLbl; diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 0b747b8ec..729b7ca57 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -83,9 +83,10 @@ bittorrent::bittorrent() : DHTEnabled(false), preAllocateAll(false), addInPause( bittorrent::~bittorrent() { qDebug("BTSession deletion"); // Do some BT related saving - saveDHTEntry(); + // XXX: Done in GUI now (earlier = safer) + /*saveDHTEntry(); saveSessionState(); - saveFastResumeData(); + saveFastResumeData();*/ // Set Session settings session_settings ss; ss.tracker_receive_timeout = 1;