https://bugs.kde.org/show_bug.cgi?id=477149

--- Comment #1 from Alexander Lohnau <alexander.loh...@gmx.de> ---
            // Check whether we got an item representing a non-existent file,
            // if so, schedule its removal from the database
            // we want to do this async so that we don't block
            std::thread([=, this] {
                QList<QString> missingResources;
                for (const auto &item : newItems) {
                    // QFile.exists() can be incredibly slow (eg. if resource
is on remote filesystem)
                    if (item.resource().startsWith(QLatin1Char('/')) &&
!QFile(item.resource()).exists()) {
                        missingResources << item.resource();
                    }
                }

                if (missingResources.empty()) {
                    return;
                }

                QTimer::singleShot(0, this->d->q, [=, this] {
                    d->q->forgetResources(missingResources);
                });
            }).detach();

This code seems related and dangerous. I wonder if it may crash if the model is
deleted and during/after that the code in the thread is run.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to