Commit 951de9ec authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make sure to delete all temporary dir

parent fa2e7cd8
Pipeline #24839 passed with stage
in 59 minutes and 9 seconds
......@@ -77,10 +77,11 @@ NodeHelper::NodeHelper()
NodeHelper::~NodeHelper()
{
if (mAttachmentFilesDir) {
mAttachmentFilesDir->forceCleanTempFiles();
delete mAttachmentFilesDir;
mAttachmentFilesDir = nullptr;
for (auto att : mListAttachmentTemporaryDirs) {
if (att) {
att->forceCleanTempFiles();
delete att;
}
}
clear();
}
......@@ -337,6 +338,7 @@ void NodeHelper::removeTempFiles()
//Don't delete as it will be deleted in class
mAttachmentFilesDir->removeTempFiles();
mAttachmentFilesDir = new AttachmentTemporaryFilesDirs();
mListAttachmentTemporaryDirs.append(mAttachmentFilesDir);
}
void NodeHelper::addTempFile(const QString &file)
......
......@@ -32,6 +32,7 @@
#include <QMap>
#include <QSet>
#include <QVector>
#include <QPointer>
class QUrl;
class QTextCodec;
......@@ -265,9 +266,9 @@ private:
QMap<QString, QMap<QByteArray, Interface::BodyPartMemento *> > mBodyPartMementoMap;
QMap<KMime::Content *, PartMetaData> mPartMetaDatas;
QMap<KMime::Message::Content *, QVector<KMime::Content *> > mExtraContents;
AttachmentTemporaryFilesDirs *mAttachmentFilesDir = nullptr;
QPointer<AttachmentTemporaryFilesDirs> mAttachmentFilesDir;
QMap<const KMime::Content *, QVector<MessagePartPtr> > mHeaderOverwrite;
QVector<QPointer<AttachmentTemporaryFilesDirs> > mListAttachmentTemporaryDirs;
friend class NodeHelperTest;
};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment