Skip to content

Commit

Permalink
Add check that the disposing scope is current, before changing the pa…
Browse files Browse the repository at this point in the history
  • Loading branch information
generik0 committed Dec 10, 2020
1 parent ecfa403 commit 36ac910
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,15 @@ internal static ExtensionContainerScope BeginScope()

public void Dispose()
{
if (current.Value == this)
{
current.Value = parent;
}

if (scopeCache is IDisposable disposableCache)
{
disposableCache.Dispose();
}

current.Value = parent;
}

public Burden GetCachedInstance(ComponentModel model, ScopedInstanceActivationCallback createInstance)
Expand Down

0 comments on commit 36ac910

Please sign in to comment.