Skip to content

Commit

Permalink
Delete worker in appropriate thread
Browse files Browse the repository at this point in the history
  • Loading branch information
glassez committed Oct 20, 2023
1 parent 9de32a7 commit 2691a16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/base/torrentfileswatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void TorrentFilesWatcher::initWorker()
connect(m_asyncWorker, &TorrentFilesWatcher::Worker::torrentFound, this, &TorrentFilesWatcher::onTorrentFound);

m_asyncWorker->moveToThread(m_ioThread.get());
connect(m_ioThread.get(), &QObject::destroyed, this, [this] { delete m_asyncWorker; });
connect(m_ioThread.get(), &QThread::finished, m_asyncWorker, [this] { delete m_asyncWorker; });
m_ioThread->start();

for (auto it = m_watchedFolders.cbegin(); it != m_watchedFolders.cend(); ++it)
Expand Down

0 comments on commit 2691a16

Please sign in to comment.