diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphinplacesmodelsingleton.cpp | 5 | ||||
| -rw-r--r-- | src/trash/dolphintrash.cpp | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/dolphinplacesmodelsingleton.cpp b/src/dolphinplacesmodelsingleton.cpp index 301150394..40fb930e4 100644 --- a/src/dolphinplacesmodelsingleton.cpp +++ b/src/dolphinplacesmodelsingleton.cpp @@ -10,6 +10,7 @@ #include <KAboutData> +#include <QCoreApplication> #include <QIcon> #include <QMimeData> @@ -120,6 +121,10 @@ bool DolphinPlacesModel::isTrash(const QModelIndex &index) const DolphinPlacesModelSingleton::DolphinPlacesModelSingleton() : m_placesModel(new DolphinPlacesModel()) { + // Destroy during QCoreApplication teardown, while KIO's KCoreDirListerCache is still alive. + qAddPostRoutine([] { + instance().m_placesModel.reset(); + }); } DolphinPlacesModelSingleton &DolphinPlacesModelSingleton::instance() diff --git a/src/trash/dolphintrash.cpp b/src/trash/dolphintrash.cpp index ae3f1e20c..66d69254a 100644 --- a/src/trash/dolphintrash.cpp +++ b/src/trash/dolphintrash.cpp @@ -16,6 +16,7 @@ #include <Solid/DeviceNotifier> #include <Solid/StorageAccess> +#include <QCoreApplication> #include <QList> Trash::Trash() @@ -53,6 +54,14 @@ Trash::Trash() }); m_trashDirLister->openUrl(QUrl(QStringLiteral("trash:/"))); + + // Destroy during QCoreApplication teardown, while KIO's KCoreDirListerCache is still alive. + // The singleton destructor fires later, but m_trashDirLister is already nullptr by then. + qAddPostRoutine([] { + auto &t = instance(); + delete t.m_trashDirLister; + t.m_trashDirLister = nullptr; + }); } Trash::~Trash() |
