mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kdecore: fix runtime assert about accessing global static after its destruction
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
47c8c442c2
commit
614568e372
1 changed files with 5 additions and 1 deletions
|
@ -22,6 +22,7 @@
|
|||
#include "kdebug.h"
|
||||
#include "kde_file.h"
|
||||
|
||||
#include <QStandardPaths>
|
||||
#include <QCoreApplication>
|
||||
#include <QThread>
|
||||
|
||||
|
@ -50,7 +51,10 @@ KLockFilePrivate::KLockFilePrivate()
|
|||
KLockFile::KLockFile(const QString &file)
|
||||
: d(new KLockFilePrivate())
|
||||
{
|
||||
d->m_lockfile = QFile::encodeName(KGlobal::dirs()->saveLocation("tmp"));
|
||||
// NOTE: KConfig may attempt to create KLockFile from its destructor when KGlobal is no more
|
||||
// thus QStandardPaths::writableLocation() is used here
|
||||
d->m_lockfile = QFile::encodeName(QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation));
|
||||
d->m_lockfile.append('/');
|
||||
d->m_lockfile.append(QByteArray::number(qHash(file)));
|
||||
d->m_lockfile.append(".klockfile");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue