Skip to content

Commit

Permalink
Merge #2175 Clean up registry lock file after parse failure
Browse files Browse the repository at this point in the history
  • Loading branch information
politas committed Nov 6, 2017
2 parents 4d3d978 + 8c3332b commit 51893b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
11 changes: 10 additions & 1 deletion Core/Registry/RegistryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 51893b1

Please sign in to comment.