mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
fix: Moving SafeCriticalSection Enters outside of tryf block, don't want to Leave if the Enter fails
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user