Stop watcher when unmounting
This commit is contained in:
parent
1956ea95ee
commit
bc37d00a81
@ -63,6 +63,7 @@ SCollection::SCollection(Application *app, QObject *parent)
|
||||
}
|
||||
|
||||
SCollection::~SCollection() {
|
||||
watcher_->Stop();
|
||||
watcher_->deleteLater();
|
||||
watcher_thread_->exit();
|
||||
watcher_thread_->wait(5000 /* five seconds */);
|
||||
|
@ -684,6 +684,8 @@ QString CollectionWatcher::PickBestImage(const QStringList &images) {
|
||||
QString biggest_path;
|
||||
|
||||
for (const QString &path : filtered) {
|
||||
if (stop_requested_) return QString();
|
||||
|
||||
QImage image(path);
|
||||
if (image.isNull()) continue;
|
||||
|
||||
|
@ -67,6 +67,7 @@ bool FilesystemDevice::Init() {
|
||||
}
|
||||
|
||||
FilesystemDevice::~FilesystemDevice() {
|
||||
watcher_->Stop();
|
||||
watcher_->deleteLater();
|
||||
watcher_thread_->exit();
|
||||
watcher_thread_->wait();
|
||||
|
Loading…
x
Reference in New Issue
Block a user