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

--- Comment #6 from Sandro Knauß <skna...@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.

Reply via email to