fix: Moving SafeCriticalSection Enters outside of tryf block, don't want to Leave if the Enter fails

This commit is contained in:
Chris Cameron
2019-09-20 10:00:36 -04:00
parent aae8bc5323
commit 602f170091

View File

@@ -13,9 +13,10 @@ namespace ICD.Common.Utils
if (callback == null)
throw new ArgumentNullException("callback");
Enter();
try
{
Enter();
callback();
}
finally
@@ -35,9 +36,10 @@ namespace ICD.Common.Utils
if (callback == null)
throw new ArgumentNullException("callback");
Enter();
try
{
Enter();
return callback();
}
finally