Fix memory leaks

Fixes a couple of memory leaks (although not dangerous in practice, since
we are talking about objects with a lifetime up to the end of the application)

PR #19650.
Closes #19632.
This commit is contained in:
Vladimir Golovnev 2023-09-27 08:00:20 +03:00
parent 7512b92a36
commit d877215018
2 changed files with 2 additions and 2 deletions

View file

@ -163,7 +163,7 @@ void TorrentFilesWatcher::initWorker()
connect(m_asyncWorker, &TorrentFilesWatcher::Worker::torrentFound, this, &TorrentFilesWatcher::onTorrentFound);
m_asyncWorker->moveToThread(m_ioThread.get());
connect(m_ioThread.get(), &QThread::finished, this, [this] { delete m_asyncWorker; });
connect(m_ioThread.get(), &QObject::destroyed, this, [this] { delete m_asyncWorker; });
m_ioThread->start();
for (auto it = m_watchedFolders.cbegin(); it != m_watchedFolders.cend(); ++it)

View file

@ -38,7 +38,7 @@
LineEdit::LineEdit(QWidget *parent)
: QLineEdit(parent)
{
auto *action = new QAction(UIThemeManager::instance()->getIcon(u"edit-find"_s), QString());
auto *action = new QAction(UIThemeManager::instance()->getIcon(u"edit-find"_s), QString(), this);
addAction(action, QLineEdit::LeadingPosition);
setClearButtonEnabled(true);