diff --git a/CHANGELOG.md b/CHANGELOG.md index cd94f02171..fe08a0c0b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file. - [Build] Fix build errors for UpdateCol (#2153 by: politas; reviewed: Olympic1) - [Core] Simplify IUser (#2163 by: HebaruSan; reviewed: politas) - [Auto-updater] Move AskForAutoUpdates dialog to center of screen (#2165 by: politas; reviewed: Olympic1) +- [Core] Clean up registry lock file after parse failure (#2175 by: HebaruSan; reviewed: politas) ## v1.22.6 (Guiana) diff --git a/Core/Registry/RegistryManager.cs b/Core/Registry/RegistryManager.cs index d2ed47bca4..754dbe13bf 100644 --- a/Core/Registry/RegistryManager.cs +++ b/Core/Registry/RegistryManager.cs @@ -47,7 +47,16 @@ private RegistryManager(string path, KSP ksp) throw new RegistryInUseKraken(lockfilePath); } - LoadOrCreate(); + try + { + LoadOrCreate(); + } + catch + { + // Clean up the lock file + Dispose(false); + throw; + } // We don't cause an inconsistency error to stop the registry from being loaded, // because then the user can't do anything to correct it. However we're