diff options
author | David Edmundson <kde@davidedmundson.co.uk> | 2015-02-12 22:29:04 +0100 |
---|---|---|
committer | David Edmundson <kde@davidedmundson.co.uk> | 2015-02-19 11:49:31 +0100 |
commit | 5a28172868cdc51607e0e87172d4d4fb6f01b896 (patch) | |
tree | 4e45afdedca8d4f514ef1f96a41ea70a565d8f2e /src/core/kconfig.cpp | |
parent | 93dd4856d096e214786734db80ac8f778b913333 (diff) | |
download | kconfig-5a28172868cdc51607e0e87172d4d4fb6f01b896.tar.gz kconfig-5a28172868cdc51607e0e87172d4d4fb6f01b896.tar.bz2 |
Avoid code path that leaves local config locked
The local config file gets locked on line 415, if we return early we
need to unlock it.
REVIEW: 122549
BUG: 344032
Diffstat (limited to 'src/core/kconfig.cpp')
-rw-r--r-- | src/core/kconfig.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/kconfig.cpp b/src/core/kconfig.cpp index 782e9714..1da816fa 100644 --- a/src/core/kconfig.cpp +++ b/src/core/kconfig.cpp @@ -440,6 +440,12 @@ bool KConfig::sync() QExplicitlySharedDataPointer<KConfigBackend> tmp = KConfigBackend::create(d->sGlobalFileName); if (d->configState == ReadWrite && !tmp->lock()) { qWarning() << "couldn't lock global file"; + + //unlock the local config if we're returning early + if (d->mBackend->isLocked()) { + d->mBackend->unlock(); + } + d->bDirty = true; return false; } |