Browse Source

Merge pull request #7422 from Chocobo1/delete

Fix dereferencing freed pointer
adaptive-webui-19844
Mike Tzou 7 years ago committed by GitHub
parent
commit
56887efdf5
  1. 4
      src/base/bittorrent/session.cpp

4
src/base/bittorrent/session.cpp

@ -1724,8 +1724,8 @@ void Session::processShareLimits()
if ((ratio <= TorrentHandle::MAX_RATIO) && (ratio >= ratioLimit)) { if ((ratio <= TorrentHandle::MAX_RATIO) && (ratio >= ratioLimit)) {
Logger* const logger = Logger::instance(); Logger* const logger = Logger::instance();
if (m_maxRatioAction == Remove) { if (m_maxRatioAction == Remove) {
deleteTorrent(torrent->hash());
logger->addMessage(tr("'%1' reached the maximum ratio you set. Removed.").arg(torrent->name())); logger->addMessage(tr("'%1' reached the maximum ratio you set. Removed.").arg(torrent->name()));
deleteTorrent(torrent->hash());
} }
else if (!torrent->isPaused()) { else if (!torrent->isPaused()) {
torrent->pause(); torrent->pause();
@ -1748,8 +1748,8 @@ void Session::processShareLimits()
if ((seedingTimeInMinutes <= TorrentHandle::MAX_SEEDING_TIME) && (seedingTimeInMinutes >= seedingTimeLimit)) { if ((seedingTimeInMinutes <= TorrentHandle::MAX_SEEDING_TIME) && (seedingTimeInMinutes >= seedingTimeLimit)) {
Logger* const logger = Logger::instance(); Logger* const logger = Logger::instance();
if (m_maxRatioAction == Remove) { if (m_maxRatioAction == Remove) {
deleteTorrent(torrent->hash());
logger->addMessage(tr("'%1' reached the maximum seeding time you set. Removed.").arg(torrent->name())); logger->addMessage(tr("'%1' reached the maximum seeding time you set. Removed.").arg(torrent->name()));
deleteTorrent(torrent->hash());
} }
else if (!torrent->isPaused()) { else if (!torrent->isPaused()) {
torrent->pause(); torrent->pause();

Loading…
Cancel
Save