Fix crash when reloading folder

This commit is contained in:
Dušan Poizl 2019-09-19 17:07:47 +02:00
parent 737b2908a5
commit dbc722a1e6
2 changed files with 7 additions and 0 deletions

@ -71,6 +71,12 @@ ImageRingList::ImageRingList(QObject *parent) : QObject(parent)
connect(&m_fileSystemWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(dirChanged(QString)));
}
ImageRingList::~ImageRingList()
{
QThreadPool::globalInstance()->clear();
QThreadPool::globalInstance()->waitForDone();
}
bool ImageRingList::setDir(const QString path, const QString &currentFile)
{
QDir dir(path);

@ -45,6 +45,7 @@ class ImageRingList : public QObject
bool m_liveMode;
public:
explicit ImageRingList(QObject *parent = 0);
~ImageRingList();
bool setDir(const QString path, const QString &currentFile = QString());
void setFile(const QString &file);
ImagePtr currentImage();