[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [kmail2] [Bug 358116] messageviewer leaks temporary files with mail parts in it
From:       Sandro Knauß via KDE Bugzilla <bugzilla_noreply () kde ! o
Date:       2016-01-29 10:17:15
Message-ID: bug-358116-17878-IEr7Tw1nCd () http ! bugs ! kde ! org/
[Download RAW message or body]

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

--- Comment #6 from Sandro Knauß <sknauss@kde.org> ---
Well I can reproduce this behaviour with a simple testcase.  This one fails:
    QString path;
    {
        NodeHelper helper;
        path = helper.createTempDir(QStringLiteral("foo"));
        QVERIFY(QDir(path).exists());
    }
    QEventLoop loop;
    QTimer::singleShot(0, &loop, &QEventLoop::quit);
    loop.exec();
    QVERIFY(!QDir(path).exists());

if I change the singleShot to something like 11000 (11secs) if passes.

The problem here is that if the NodeHelper instance is deleted the tempfiles
are deleted also only 10secs after the application and not directly with the
deletion of NodeHelper. I see no need to wait 10secs when the object is already
deleted.

NodeHelper::~NodeHelper()
{
    //Don't delete it it will delete in class with a deleteLater;
    if (mAttachmentFilesDir) {
        mAttachmentFilesDir->removeTempFiles();
        mAttachmentFilesDir = 0;
    }
}

void AttachmentTemporaryFilesDirs::removeTempFiles()
{
    QTimer::singleShot(d->mDelayRemoveAll, this,
&AttachmentTemporaryFilesDirs::slotRemoveTempFiles);
}

^^ d->mDelayRemoveAll is 10secs.

-- 
You are receiving this mail because:
You are watching all bug changes.=
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic