diff --git a/src/Spring/Spring.Core/Reflection/Dynamic/DynamicMethod.cs b/src/Spring/Spring.Core/Reflection/Dynamic/DynamicMethod.cs index 6ae7f637..cb3a32c3 100644 --- a/src/Spring/Spring.Core/Reflection/Dynamic/DynamicMethod.cs +++ b/src/Spring/Spring.Core/Reflection/Dynamic/DynamicMethod.cs @@ -124,9 +124,10 @@ namespace Spring.Reflection.Dynamic lock (stateCache.SyncRoot) { - if (stateCache[methodInfo] == null) + state = (SafeMethodState)stateCache[methodInfo]; + if (state == null) { - state = newState; + state = newState; stateCache[methodInfo] = state; } } @@ -135,7 +136,6 @@ namespace Spring.Reflection.Dynamic this.methodInfo = methodInfo; } - /// /// Invokes dynamic method. ///