Browse Source

- Save session data and fast resume data sooner on exit (in case)

adaptive-webui-19844
Christophe Dumez 16 years ago
parent
commit
45efcfce13
  1. 4
      src/GUI.cpp
  2. 5
      src/bittorrent.cpp

4
src/GUI.cpp

@ -241,6 +241,10 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
GUI::~GUI() { GUI::~GUI() {
qDebug("GUI destruction"); qDebug("GUI destruction");
hide(); hide();
// Do this as soon as possible
BTSession->saveDHTEntry();
BTSession->saveSessionState();
BTSession->saveFastResumeData();
delete dlSpeedLbl; delete dlSpeedLbl;
delete upSpeedLbl; delete upSpeedLbl;
delete ratioLbl; delete ratioLbl;

5
src/bittorrent.cpp

@ -83,9 +83,10 @@ bittorrent::bittorrent() : DHTEnabled(false), preAllocateAll(false), addInPause(
bittorrent::~bittorrent() { bittorrent::~bittorrent() {
qDebug("BTSession deletion"); qDebug("BTSession deletion");
// Do some BT related saving // Do some BT related saving
saveDHTEntry(); // XXX: Done in GUI now (earlier = safer)
/*saveDHTEntry();
saveSessionState(); saveSessionState();
saveFastResumeData(); saveFastResumeData();*/
// Set Session settings // Set Session settings
session_settings ss; session_settings ss;
ss.tracker_receive_timeout = 1; ss.tracker_receive_timeout = 1;

Loading…
Cancel
Save