diff --git a/src/Lucene.Net.TestFramework/Support/Util/RandomizedContext.cs b/src/Lucene.Net.TestFramework/Support/Util/RandomizedContext.cs index 51357e526a..e198e18626 100644 --- a/src/Lucene.Net.TestFramework/Support/Util/RandomizedContext.cs +++ b/src/Lucene.Net.TestFramework/Support/Util/RandomizedContext.cs @@ -204,8 +204,8 @@ internal void DisposeResources() UninterruptableMonitor.Enter(contextLock); try { - resources = disposableResources; - disposableResources = null; + resources = disposableResources; // Set the resources to a local variable + disposableResources = null; // Set disposableResources field to null so our local list will go out of scope when we are done } finally { @@ -245,7 +245,7 @@ internal void DisposeResources() ExceptionDispatchInfo.Capture(th).Throw(); // LUCENENET: Rethrow to preserve stack details from the original throw } } - } // toDispose goes out of scope here - no need to Clear(). + } // resources goes out of scope here - no need to Clear(). /// /// Prints a stack trace of the to the destination .