Undoing a bad previous change where logic in a catch should have been in a finally. Also dispose could throw an error so catch it and complete the clean up.

This commit is contained in:
JohnBlair
2019-10-18 07:17:56 +01:00
committed by Shannon
parent 77f34e8466
commit d774ff8bc1

View File

@@ -238,11 +238,21 @@ namespace Umbraco.Web.PublishedCache.NuCache
// Trying to lock could throw exceptions so always make sure to clean up.
Lock(lockInfo);
}
catch
catch { throw; }
finally
{
if (_localDb == null) return;
_localDb.Dispose();
_localDb = null;
if (_localDb != null)
{
try
{
_localDb.Dispose();
}
catch { /* TBD: May already be throwing so don't throw again */}
finally
{
_localDb = null;
}
}
}
}