diff options
author | James Beddek <telans@posteo.de> | 2023-06-20 16:54:15 +1200 |
---|---|---|
committer | James Beddek <telans@posteo.de> | 2023-06-20 16:54:15 +1200 |
commit | f2471f0f68e436d25d27ccc750e6668c07a29070 (patch) | |
tree | 02f6af6505c6637bbc94b8689adab6c43364f411 /launcher/ui | |
parent | d9b24f770561e3bb139955854ac7f3ca4d92a122 (diff) | |
download | PrismLauncher-f2471f0f68e436d25d27ccc750e6668c07a29070.tar.gz PrismLauncher-f2471f0f68e436d25d27ccc750e6668c07a29070.tar.bz2 PrismLauncher-f2471f0f68e436d25d27ccc750e6668c07a29070.zip |
Screenshots: clear the thumbnailing pool on page delete
Removes pending QThreadPool jobs which linger after page delete.
May help with #1201 by allowing the pool to finish earlier.
Signed-off-by: James Beddek <telans@posteo.de>
Diffstat (limited to 'launcher/ui')
-rw-r--r-- | launcher/ui/pages/instance/ScreenshotsPage.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/launcher/ui/pages/instance/ScreenshotsPage.cpp b/launcher/ui/pages/instance/ScreenshotsPage.cpp index 8f134efd..9d1f8421 100644 --- a/launcher/ui/pages/instance/ScreenshotsPage.cpp +++ b/launcher/ui/pages/instance/ScreenshotsPage.cpp @@ -146,7 +146,11 @@ public: m_thumbnailCache->add("placeholder", APPLICATION->getThemedIcon("screenshot-placeholder")); connect(&watcher, SIGNAL(fileChanged(QString)), SLOT(fileChanged(QString))); } - virtual ~FilterModel() { m_thumbnailingPool.waitForDone(500); } + virtual ~FilterModel() { + m_thumbnailingPool.clear(); + if (!m_thumbnailingPool.waitForDone(500)) + qDebug() << "Thumbnail pool took longer than 500ms to finish"; + } virtual QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const { auto model = sourceModel(); |