Browse Source

Don't forget to delete worker thread object

PR #19655.
adaptive-webui-19844
Vladimir Golovnev 1 year ago committed by GitHub
parent
commit
7ab90cfc40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/base/bittorrent/dbresumedatastorage.cpp

9
src/base/bittorrent/dbresumedatastorage.cpp

@ -288,7 +288,7 @@ namespace BitTorrent
Q_DISABLE_COPY_MOVE(Worker) Q_DISABLE_COPY_MOVE(Worker)
public: public:
Worker(const Path &dbPath, QReadWriteLock &dbLock); Worker(const Path &dbPath, QReadWriteLock &dbLock, QObject *parent = nullptr);
void run() override; void run() override;
void requestInterruption(); void requestInterruption();
@ -332,7 +332,7 @@ BitTorrent::DBResumeDataStorage::DBResumeDataStorage(const Path &dbPath, QObject
updateDB(dbVersion); updateDB(dbVersion);
} }
m_asyncWorker = new Worker(dbPath, m_dbLock); m_asyncWorker = new Worker(dbPath, m_dbLock, this);
m_asyncWorker->start(); m_asyncWorker->start();
} }
@ -653,8 +653,9 @@ void BitTorrent::DBResumeDataStorage::enableWALMode() const
throw RuntimeError(tr("WAL mode is probably unsupported due to filesystem limitations.")); throw RuntimeError(tr("WAL mode is probably unsupported due to filesystem limitations."));
} }
BitTorrent::DBResumeDataStorage::Worker::Worker(const Path &dbPath, QReadWriteLock &dbLock) BitTorrent::DBResumeDataStorage::Worker::Worker(const Path &dbPath, QReadWriteLock &dbLock, QObject *parent)
: m_path {dbPath} : QThread(parent)
, m_path {dbPath}
, m_dbLock {dbLock} , m_dbLock {dbLock}
{ {
} }

Loading…
Cancel
Save