mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kdecore: interrupt lock attempts from KLockFile destructor
every while loop should have interrupt point, this one did not Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
922d02660b
commit
198997f5e1
1 changed files with 2 additions and 1 deletions
|
@ -62,6 +62,7 @@ KLockFile::KLockFile(const QString &file)
|
|||
KLockFile::~KLockFile()
|
||||
{
|
||||
unlock();
|
||||
d->m_lockfile.clear();
|
||||
delete d;
|
||||
}
|
||||
|
||||
|
@ -77,7 +78,7 @@ bool KLockFile::tryLock()
|
|||
|
||||
void KLockFile::lock()
|
||||
{
|
||||
while (!tryLock()) {
|
||||
while (!tryLock() && !d->m_lockfile.isEmpty()) {
|
||||
QCoreApplication::processEvents(QEventLoop::AllEvents, KLOCKFILE_TIMEOUT);
|
||||
QThread::msleep(KLOCKFILE_SLEEPTIME);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue