You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing a plugin for SpecFlow to support Ninject. Somewhere in my tests, it turns I resolve the IObjectContainer out of my Ninject kernel and then I dispose the IObjectContainer. To be more precise, I am doing something like this:
At the end of that test, expectedScenarioContainer.Dispose() is called, thanks to the using directive. That calls the Dispose() on the IObjectContainer, which calls the Dispose() method of my IKernel (my ninject container). Because my IKernel is provided with
the IObjectContainer.Dispose() is once again called, therefore we hit this code concurrently. In that process, the ObjectContainer.objectPool.Values are modified by another process within the loop, and the disposing process results in failure.
Would that be imagineable to fix that?
The text was updated successfully, but these errors were encountered:
One more detail: this bug occurs with SpecFlow 3.9.8 and BoDi 1.5.0. The last versions the code in my above post worked was SpecFlow 3.6.23 and BoDi 1.4.1.
I am writing a plugin for SpecFlow to support Ninject. Somewhere in my tests, it turns I resolve the
IObjectContainer
out of my Ninject kernel and then I dispose the IObjectContainer. To be more precise, I am doing something like this:At the end of that test,
expectedScenarioContainer.Dispose()
is called, thanks to theusing
directive. That calls theDispose()
on theIObjectContainer
, which calls theDispose()
method of myIKernel
(my ninject container). Because myIKernel
is provided withthe
IObjectContainer.Dispose()
is once again called, therefore we hit this code concurrently. In that process, theObjectContainer.objectPool.Values
are modified by another process within the loop, and the disposing process results in failure.Would that be imagineable to fix that?
The text was updated successfully, but these errors were encountered: