From a325ab8d6e5151ae26dbcdc8626fa2db7495cb34 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 17 Oct 2022 03:17:32 +0800 Subject: [PATCH] Delay saving session statistics Pausing the libtorrent session should be scheduled before this. --- src/base/bittorrent/sessionimpl.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/base/bittorrent/sessionimpl.cpp b/src/base/bittorrent/sessionimpl.cpp index 04888a2c6..9d85c7944 100644 --- a/src/base/bittorrent/sessionimpl.cpp +++ b/src/base/bittorrent/sessionimpl.cpp @@ -1030,11 +1030,12 @@ void SessionImpl::setGlobalMaxSeedingMinutes(int minutes) // Main destructor SessionImpl::~SessionImpl() { - saveStatistics(); - - // Do some BT related saving + // Do some bittorrent related saving + // After this, (ideally) no more important alerts will be generated/handled saveResumeData(); + saveStatistics(); + // We must delete FilterParserThread // before we delete lt::session delete m_filterParser;