┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/trash/dolphintrash.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/trash/dolphintrash.cpp')
-rw-r--r--src/trash/dolphintrash.cpp9
1 files changed, 9 insertions, 0 deletions
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()